2024-01-24, 08:51 PM
(This post was last modified: 2024-01-24, 08:52 PM by rbergevoet.)
(2024-01-24, 07:57 PM)seandepagnier Wrote: that isnt what I read. I think he realizes the motor controller must use the only hardware serial port on the pi and to add an additional port would need bitbanging.
You are both right:
I do plan (and have programmed) an Arduino Mega with a modified motor.ino that includes SeaTalk1 communication to the Raymarine autopilot control head St7002. I only have run it on my desk and it seems to be stable. I do not check the Seatalk bus for activity when sending data. There is a chance of missing a button press (Arduino receiving data), I’ll just have to press it again. Not a big deal. There is a chance of missing a status update (Arduino sending course, status etc), of I miss that it will be sent again quickly enough not to ‘loose connection’ with the Seatalk bus (happens when no ‘command’ is received in time by the control head). I do have a ‘check bus activity’ code piece ready but have not tested it in action.
I also got that the Pi zero has only 1 serial connection and that it is used for communication with the Arduino motor controller already.
I use an Arduino Mega because I need 4 serial ports for communication: 1 for the Pi-to-Arduino motor, 1 for sending to the SeaTalk1 bus, 1 for receiving the seatalk1 bus data (I have been working for very long on comms to Seatalk with 1 connection but there does not seem to be a working library that does both… I actually use 2 different libraries) and the last one (now used for debuging) will be for receiving the course and pilot course from the Pi to send in to the Raymarine control head.
If it indeed turns out that the Seatalk communication on the same Arduino as the motor controlling interferes with it, I can of course add an Arduino, but I will first try it with just one.
I will look at your example code and see of I can get that changed to what I want. I am not familiar with running programs as services, so I have some more Google-work to do
Thanks for your answers!!