(2018-03-05, 06:26 PM)Rooney Wrote: Hello Christian,
attached you'll find the pinout of the Moitessier HAT. GPIOs marked green are used by the Moitessier HAT itself, GPIOs marked red are available at the optional IO header and are for free use.
If multiple HATs are stacked, the Moitessier HAT needs to be on top, otherwise the GNSS patch antenna would not work. This is the reason why no 40 pin header is available on the PCB top layer.
Regards,
Rooney
Hello Rooney
thank you for this information - even if it means that the integration of Moitessier in my setup will be a bit more complicated...
I had already reasoned that I would need an external antenna, as the Pi is stocked to far downstairs to get proper signal.
fair winds
Christian
(2018-03-08, 02:22 AM)GSAtlantic Wrote: Would you be willing to share how you’ve integrated your paddle wheel?
Some code you’ve written yourself?
Hello Geoff,
yep, I felt adventurous and tried to do a bit of python-coding on myself. Not that I am expert - if anybody has a better idea how to transform pulses in speed measurement, I am glad to learn:
Code:
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
import os
GPIO.setmode(GPIO.BCM)
GPIO.setup(24, GPIO.IN, pull_up_down = GPIO.PUD_UP)
path = "/var/run/nmea.fifo"
os.mkfifo(path)
fifo = open(path, "w")
fifo.write('$VWVHW,,,,,0,00,N,,K\r\n')
fifo.close()
impulse_count = 0
NUM_CYCLES = 10
Counter = 10
while 1:
start = time.time()
for impulse_count in range(NUM_CYCLES):
GPIO.wait_for_edge(24, GPIO.FALLING)
duration = time.time() - start
Counter = Counter + 10
distance = Counter / 54737
distancer = round(distance,2)
speed = 15.2047222222 / duration
speedr = round(speed,2)
nmea = '$VWVHW,,,,,' + str(speedr) + ',N,,K\r\n$VWVLW,,N,' + str(distancer) + ',N\r\n'
fifo = open(path, "w")
fifo.write(str(nmea))
fifo.close()
time.sleep(0.5)
GPIO.cleanup()
The code counts 10 pulses and measures the time it takes. The paddlewheel documentation for the VDO says it counts 54737 pulses per 1nm, so this gives a basis for calculating speed in knots.
Then the values are transformed into NMEA-sentences and piped via a FIFO to kplex, which sends the NMEA to the cockpit.
Code:
[file]
name=logge
filename=/var/run/nmea.fifo
direction=in
persist=yes
checksum=no
strict=no
The script is started from rc.local so it runs as root. Security concerns are not so high on a standalone-system
Certainly there are ways to do this in a more elegant fashion... but I am not really a programmer.
Hope it helps though.
fair winds
Christian