Serial communication between Arduino UNO and Rasp Pi3 [Help needed]

Hello,
we had to use an Arduino UNO for our implementation of SatNOGs rotator.
We have 2 NEMA 17 steppers and 2 drivers A4988 Pololu.
The big question we want to ask is if anyone knows how can we make the serial communication between Raspberry Pi and Arduino UNO using the USB port from Rasp Pi and Serial port of the Arduino (like in the image below). Anyone knows how could this be done? Should we make any change in Arduino’s configuration? or perhaps in RaspPi’s?
Any tip on maybe how to modify easycomms.h to use Serial communications instead of RS485 or UART? (or it’s fine the way it is now?)

image

I vaguely remember having to make some changes and define which serial port to change on the arduino Leonardo to make it talk on the USB port. something like “define SerialPort Serial” without the quotes. And I also had to set the baudrate to 9600.

I’m not a programmer so use with a pinch of salt.
73 Bob

Hey! @proyecto.ETS.uy take a look in this wiki page.

Hello everybody, first thanks in advance for the help, I’ve been fighting for over a month with little advance.
I’ve been trying azisi’s tip but something still isn’t working.

This is the current situation:
I’m using full step, for stepper motors with A4988 pololu drivers. (now both motors are free to run, no torque on them).
I’ve divided the problem in two, first I beleave the RaspberryPi is not sending any commands, and second the Arduino is not responding to the commands even when I send them from my computer. I changed easycomm.h as the post azisi sheared last reply, in order to use serial ( Serial.read()) instead of rs485 (it’s just like the other version but using serial 9600 baudios instead of rs485 just like in the link below )

At the bottom are the raspberry’s config and the arduino/driver/endstop/motor conextions.

Here is where the noob questions starts:

1 - Do i need to configure anything else like gpredict in order for the raspberry to do it’s magic and send the commands? (I’ve seen posts like this one “Arduino problem with gPredict and rotctld - #11 by ruks” where it seems I need to do a few things before it works) but I didn’t find this steps while installing satnogs client

2 - When I energise the Arduino It starts moving until I press the endstops (twice to be “home”, so I can say the drivers and motors are working fine) but then even when I try sending commands through USB from my computer (something like “AZ100.0 EL045.0” as should easycommIII be, i’ve try lots of combinations) I see the RX light blink but no movement at all (example below)

Here is Rapspi config, I’ve also tried using ttyUSB0 and ttyUSB1:
204 - Hamlib - EasycommIII
Hotspot%20config

Here is the board conextion:

Hello people,

seems like we solved Raspberry’s problems, but we are still fighting with this rotor, It still do not respond to commands.

We edited a rule so our device always appears as /dev/ttyHOTSPOT that’s why rotctl -r use that device.
root@TheNewHotSpot:/etc/udev/rules.d# vi 99-com.rules

As shown in the picture, we tried sending P 90 45 and at least got the Rx blinking in the Arduino board (no movement though)
image

And as shown in the next image, when tried to get the actual position using command p we are getting some kind of time out error, we believe because the Arduino is not answering
image

To go further with debbuging the issue, we decided to send commands directly from IDE serial monitor, now confident that we are sending commands in the correct format AZ90.0 EL45.0 or even AZ90.0 EL45.0 UP000 XXX DN000 XXX., but we still see no movement after the homing rutine. (I believe this shows the motors and drivers work fine)

(Picture below are not the actual attemps we made, it’s just for show)

We have tried modifing our drivers A4988 Pololu’s Vref in order to get higher current in the stepper motors (aprox 1A at this point), but nothing changed except the noise the motors are making while staying parked (supposly waiting for instructions) and the heat in both driver’s heatsinks which is kind of scary after a few minutes turned on. It’s important to make clear that both steppers are free to move at the moment (no torque on them yet, first we are tring to get them to move as instructed).

Any suggestion on what could be not working will be highly appreciated, and any tips on how to debug this issue will be taken in count.

1 Like

You stated that you

Just a guess: is baudrate set correct? Is the arduino’s clock setup properly?

@proyecto.ETS.uy Could you follow the Troubleshooting hints? :slight_smile:

2 Likes

Both baudrates are 9600
in rotctl(d) -s
and in serial.begin(9600)

About Arduino’s clock setup I have not checked that, I’ll sure do. What would be an appropriate clock calibration?

Azisi, now that you mention I have not tried those commands, I thought I’m having a communication issue but maybe it’s some other kind, I’ll try GS and GE and come back with more feedbacks.
Thank you very much both of you, let’s cross our fingers for some kind of response from Arduino

I remember a guy stating his setup was absolutely correct, but there was an issue with the clock source itself: there are two different versions of arduinos available! The one he was using ran on half the clock…

1 Like

Just to give closure to this thread I got the communication to work, I changed Baudrates to 19200 and somhow that made the trick.

Now I posted a new question in here:

because rotor won’t move with scheduled observations through satnog network, so I’m asking for any tip I can get.
First of all, someone telling me if I need GPredict to move it or not (I know it’s not necesary for a station to work, I need to know if it’s necesary for a rotor to work and how)

Thanks a lot

1 Like

Ok, that seems exactly the problem I described earlier: a configured 9600 baudrate should work as 9600! If it works with 19200 you are running the arduino on the double clock frequency! Check if you picked the correct device (there are only two different ones IIRC). If in doubt: try each :wink:

3 Likes