2020-02-21, 08:31 PM
(2020-02-21, 05:16 AM)beholder77 Wrote:(2020-02-20, 07:38 PM)seandepagnier Wrote: How did you manage the RF remote? My solution uses an arduino to sample the receiver and communicate via spi to the raspberry.
I'm using RXB6 connected to arduino as RF received
My arduino connected to RPI with usb and it's virtual serial port i assigned to kplex in "both" direction mode (because i wanted arduino to receive and parse some NMEA from RPI).
Then i little cheated and made new NMEA sentence intended to manage pypilot that arduino will send to kplex
For example:
$APXXX,ap.enabled,true*05
or
$APXXX,ap.heading_command,323*0A
and etc...
So all i did on RPI side is added new node-red flow to receive this NMEA, parse and send to pypilot signalk server
with function code
Code:var th = msg.payload.replace("\$APXXX,","").slice(0, -5).split(",");
msg.payload = '{\"name\": \"'+th[0]+'\", \"method\": \"set\", \"value\": '+th[1]+'}\n'
return msg;
I guess maybe this is not the right way to do such thing... I think that i'm able to just parse serial from arduino in node-red and forward commands to pypilot signalk server (without using kplex).
But in future i hope to replace arduino nano with arduino mega and use it to multiplex NMEA from various instruments and send it to RPI
(2020-02-19, 07:56 PM)Saqqara Wrote: Would you mind sharing your code and more about how it is wired up?
I will try to draw the wirings and describe things...
So if i understand correctly you are able to control all the autopilot functions through the arduino serial connection sending messages back and forth through signalk? That seems like a very elegant solution for a helm based control and display interface. 32u4 based arduinos have an extra hardware uart and high speed built in usb serial.
Would love to see the code and implementation as well.