This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Second MPU for windfane
#10
(2018-09-24, 08:38 AM)KolonelP Wrote: I send the following two scenteces to signal K

    sendMessageFloat("Windvane","environment.wind.angleApparent",heading);

    sendMessageFloat("Windvane","environment.wind.directionMagnetic",heading);

I let SignalK convert it to NMEA scenteces.
For now I do not have an anemometer so I simulated that with SignalK. Now it is shown in OpenCPN. But my heading calculation is from North not from the bow. Still have to fix the code, and enhance it with anemometer.

I use the following code to send the sentences to SignalK using python

Code:
import socket
       sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
       SignalK = '{"updates":[{"$source":"OPserial.wind","values":['
       SignalK += '{"path":"environment.wind.speedApparent","value":'+str(aws)+'}'
       SignalK += ',{"path":"environment.wind.angleApparent","value":'+str(awa)+'}'
       SignalK += ']}]}\n'
       #print (SignalK)
       sock.sendto(SignalK, ('127.0.0.1', 55559))
       sock.close()
I don't why you would need two sets of wind sensors.
I built my sensors but i am going to change next season as mine are to clunky and heavy, I added a Var to hold the offset to the bow so it reads correctly regardless of how my sensor is orientated to the bow. true wind is a calculation.
I had some issues when i updated to stretch due to the fact that the SPI bus speed changed. So i added a line to lib_nrf24.py to explicitly set spi bus speed.. I use a NRF240l+ to transmit data to and from the masthead .
The masthead controls my anchor light and transmits wind data to the Pi, I used it because it was cheap and has very low power requirements. the down side is that it is a bit a pain to code and hard to debug. It is a work in-progress.
Code:
self.spidev.open(0, csn_pin)
       # debug
       self.spidev.max_speed_hz = 400000 # change for stretch
       self.ce_pin = ce_pin
I found this after several days of hair pulling and checking all my connections.

How did you set up the conversion in SignalK??
Reply


Messages In This Thread
Second MPU for windfane - by KolonelP - 2018-09-16, 01:04 PM
RE: Second MPU for windfane - by jim321 - 2018-09-16, 01:34 PM
RE: Second MPU for windfane - by Sailoog - 2018-09-16, 05:28 PM
RE: Second MPU for windfane - by KolonelP - 2018-09-16, 06:26 PM
RE: Second MPU for windfane - by jim321 - 2018-09-16, 06:32 PM
RE: Second MPU for windfane - by KolonelP - 2018-09-16, 10:23 PM
RE: Second MPU for windfane - by KolonelP - 2018-09-18, 10:06 PM
RE: Second MPU for windfane - by ddelorme - 2018-09-23, 05:58 PM
RE: Second MPU for windfane - by KolonelP - 2018-09-24, 08:38 AM
RE: Second MPU for windfane - by ddelorme - 2018-09-24, 01:18 PM
RE: Second MPU for windfane - by KolonelP - 2018-09-24, 03:37 PM
RE: Second MPU for windfane - by PaddyB - 2018-09-24, 06:09 PM
RE: Second MPU for windfane - by KolonelP - 2018-09-24, 09:57 PM
RE: Second MPU for windfane - by PaddyB - 2018-09-28, 11:13 AM
RE: Second MPU for windfane - by seandepagnier - 2018-12-31, 09:01 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)