fredebec
France
Asked
Hi,
I have successfully connected ARC to the Pi using the EZBPi server, but I don't understand how to access the GPIOs of the Pi. If I want to set or read a digital port, how do I know which port in ARC correspond the right GPIO pinout?
Related Hardware Raspberry Pi
Related Controls
Read Digital
Set Digital
check this page: https://synthiam.com/GettingStarted/Build-Robots/Raspberry-Pi-17681
I believe the EZ-PI server uses the GPIOx mapping so ARC PORT 5 = GPIO5 = Raspberry PI PIN 29 If my guess is correct the GPIO24,GPIO25,GPIO26,GPIO27 are inaccessible due to EZB protocol limit of 24 ports (0..23)
Thanks PTP,
I was aware of the Pi GPIOs map, but I didn't get that there was a direct match between ARC port numbers and the Pi GPIO numbers. I am going to test it tonight.
Bear in mind the raspberry pi is not 5v tolerant.
if you are reading logic voltages the limit is 3.3v
Ok, I made a test and it doesn't work. As a test, I try to switch on/off a LED with the "Set Digital" control. It works with my EZB v4 (so no issue with the LED), but not with the Pi (I have tested different pinouts)...
Can you explain how you wire the led ?
you can’t wire a led without a resistor.
The LED is indeed wired with a resistor and works with the EZB v4 (I can switch it with the Set Digital control). It works also on the Pi if I plug it on the 3.3v pinout (+ground). It just seems that i cannot set digital on other GPIOs...
Let's troubleshoot the issue:
connect your led (and the resistor) to pin 12 (GPIO 18)
open a console and run the commands below:
initialize the pin direction:
switch on:
switch off:
Let me know if you can toggle the led.
OK, thanks ptp
But first command, first error.
I don't have a /gpio18 folder in /sys/class/gpio
Update:
Ok, all commands work now after some reading in the Pi forums. I had to run:
Then, I have successfully toggle the led.
And ezbpi server can toggle the gpio18 / port 18?
No, no success with ARC via the ezbpi server...
One question the led should switch ON with digital ON or digital OFF ?
On the EZB v4, the led is switched ON with digital ON.
There was an issue with setting the pin to LOW and also with reading its value. I tested it and it works now (port mappings are GPIOX <> DX as already mentioned). I have uploaded a new version 5 here https://synthiam.com/Firmware/EZBPi-Server-SXQJXC3FIQ5.
Please give it a try and let me know how it goes.
Hi Amin,
Thanks for your help and the new firmware. Sadly, it is not working and I still cannot switch ON the led.
When I add the "read digital" control on the same port 18, it doesn't go green when i put the "set digital" ON. Moreover, when I put the "read digital" control on the same port than "set digital" control, this later does not stay green when I click on it and go back to red immediately. I don't know if that makes ant sense to you...
@fredebec
Please post the output of the following commands:
@fredebec what you are describing is very similar to the behavior of the old firmware. Reading a port used turn it off. Can you please report the version that is running on your Pi? The version is in the first lines that EZBPi.exe prints to the console when you run it.
@amin, I have the last version. The first line says: "Raspberry EZBPi Version: 2019.8.27.1"
@ptp, here we go:
@fredebec I did more tests and couldn't reproduce this issue even after updating my rpi.gpio package to match yours. Can you please run EZBPi in verbose (with --verbose) and try to set the port and copy paste whatever is printed on EZBPi console?
@amin, I am afraid that it is not so verbose...
Here is what happens if I set the port on & off and disconnect
Here is what happens if I do the same but with the "read digital" control
Also, I don't know if it is off any help, but when I run the EZBPi server, I can still run the Pi commands
and successfully switch on the led, without any interference or impact on the EZBPi server or ARC...
Hi,
Just for you to know, I am still not able to use the Digital control...
Another thing I have observed is that there is a 1-2 seconds latency when I use the PiCamera through ARC. There is no latency when I use a PiCam program. So, not much luck for me with the EZBPiServer so far...
@Fredebec: I have the same issue digital ports don't work too.
I wrote an EZB Server version codename:Blueberry Server inline with Raspberry and B for Blueberry
Check the instructions: https://synthiam.com/Firmware/EZB-Server-BlueBerry-Server-DBJJ5DRNAAH
Audio is supported, but is deactivated on the code.
If you want explore more my implementation drop some posts on the above thread.
@ptp
Cool, thanks. For sure, I am going to test it. See you on the other thread...