gwpi
Posts: 5
Joined: Sun Feb 24, 2013 11:34 pm

RPi + Alamode + RS485 shield

Mon Apr 15, 2013 9:32 pm

Hi
Pardon the confusion,
I am working on a project interfacing an arduino to the pi.
I had used an Arduino Uno with an RS-485 shield to communicate with a 485 device and used the i2c bus to communicate between the pi and uno using python. Sorted everything out between the two stand alone devices and it works great.
Then I found the Alamode and it looked like a good fit.
I used the pi with the arduino ide to upload the sketch I had used on the uno, to the alamode, and it uploaded fine.
Now when i run my python script to read data from the i2c bus, it reads the correct values from the alamode, which read the correct values from the 485 device, but the alamode uart kindof stops updating. The values from the first alamode poll of the 485 device keep being sent across the i2c bus.
For testing I use my laptop as the 485 slave device to the alamode master and i can monitor the serial comms, and they are good, polling every two seconds but my python code only shows the values from the first poll and does not change until a reboot and then the same thing happens with the first poll again.
When I use the uno and pi setup standing alone, same code, I get continual updates and everything is good but also there are only SCL, SDA, and GND pins between the two.
I'm guessing it has something to do with uart port on the alamode but I'm not sure, the rs-485 shield takes over the uart port when installed so I can't use the arduino ide to upload sketches through dev/ttyS0.
Can I disable dev/ttyS0? would that have an effect? Is there any error files I can check to see if there's a conflict?
Thanks for help!

gwpi
Posts: 5
Joined: Sun Feb 24, 2013 11:34 pm

Re: RPi + Alamode + RS485 shield

Mon Apr 15, 2013 10:44 pm

Just an update,
I wired the alamode to the pi with just (i2c) SDA, SCL, 5V and GND and everything works as it should, for some reason I get the hang up when all the pins are connected, still looking at that uart port as the culprit. Hope this helps :?

osbock
Posts: 19
Joined: Fri Jun 08, 2012 1:07 pm

Re: RPi + Alamode + RS485 shield

Tue Apr 16, 2013 1:26 pm

Hi,
I suspect the problem is with the Raspberry Pi doing something on the Uart pins of the GPIO connector.
Did you do the complete AlaMode install? The normal Raspbian distro opens /dev/ttyAMA0 (the same port that we rename /dev/ttyS0 for arduino IDE compatibility) for logging and also runs a getty on it.
I would suspect that you should disable both the Getty and the logging. I don't think the symlink to /dev/ttyS0 would affect anything.
-kevin
co-designer alamode.

gwpi
Posts: 5
Joined: Sun Feb 24, 2013 11:34 pm

Re: RPi + Alamode + RS485 shield

Tue Apr 16, 2013 2:15 pm

Hi and thanks,

Yes, I went through the alamode install and confirmed both the logging and getty are disabled. I also used /dev/ttyS0 to upload the arduino sketch and it worked good. I like the option of being able to upload sketches but its not a necessity, so I was wondering if uninstalling the arduino IDE and removing /dev/ttyS0 would help. Could I configure the rpi uart gpio pins to be general i/o pins when I don't need to upload a sketch and convert back to uart when I do, like a software on/off switch for the uart.
Maybe just cut the uart pins off the pi so they don't make a connection to the alamode? Thanks for any help!

gwpi
Posts: 5
Joined: Sun Feb 24, 2013 11:34 pm

Re: RPi + Alamode + RS485 shield

Tue Apr 16, 2013 3:10 pm

Playing with the wires more, still only with i2c and power connected, I found that if pin8 (uart Tx) is connected between the pi and alamode, the polling from the rs485 shield to the 485 device is interrupted, if I remove the wire, the polling returns to normal. On the rpi, how can I tell what takes this port over, and can I disable this?

Return to “HATs and other add-ons”