Welcome to Synthiam!

Program robots using technologies created from industry experts. EZ-Builder is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.
Get Started

France
Asked

Ezbpi Server - Access To The Pi Gpios

Hi,

I have successfully connected EZ-Builder 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 EZ-Builder correspond the right GPIO pinout?


Related Hardware Raspberry Pi
Related Controls Read Digital Set Digital
AI Support Bot
AI Support Bot
Synthiam
Hello There! I'm a bot. Bip. Boop. I've searched other questions, tutorials and controls related to your question. Take a look at these links. They're all sorted by what I believe is the most relevant:
#16  
@fredebec

Please post the output of the following commands:

Code:

cat /sys/firmware/devicetree/base/model

Code:

cat /proc/cpuinfo

Code:

cat /etc/os-release

Code:

uname -a

Code:

gpio -v

Code:

pip show rpi.gpio
Synthiam
#17  
@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.
#18  
@amin, I have the last version. The first line says: "Raspberry EZBPi Version: 2019.8.27.1"
#19  
@ptp, here we go:

Code:

pi@fredebec-pi:~ $ cat /sys/firmware/devicetree/base/model
Raspberry Pi 4 Model B Rev 1.1pi@fredebec-pi:~ $

Code:

pi@fredebec-pi:~ $ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 1
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 2
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 3
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

Hardware : BCM2835
Revision : c03111
Serial : 1000000082e0e07d

Code:

pi@fredebec-pi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Code:

pi@fredebec-pi:~ $ uname -a
Linux fredebec-pi 4.19.66-v7l+ #1253 SMP Thu Aug 15 12:02:08 BST 2019 armv7l GNU/Linux

Code:

pi@fredebec-pi:~ $ gpio -v
gpio version: 2.50
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
Type: Unknown17, Revision: 01, Memory: 0MB, Maker: Sony
* Device tree is enabled.
*--> Raspberry Pi 4 Model B Rev 1.1
* This Raspberry Pi supports user-level GPIO access.

Code:

pi@fredebec-pi:~ $ pip show rpi.gpio
Name: RPi.GPIO
Version: 0.7.0
Summary: A module to control Raspberry Pi GPIO channels
Home-page: http://sourceforge.net/projects/raspberry-gpio-python/
Author: Ben Croston
Author-email: ben@croston.org
License: MIT
Location: /usr/lib/python2.7/dist-packages
Requires:
Required-by: skywriter, rainbowhat, phatbeat, motephat, envirophat, Cap1xxx, blinkt, automationhat
Synthiam
#20  
@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?
#21  
@amin, I am afraid that it is not so verbose...

Here is what happens if I set the port on & off and disconnect

Code:

pi@fredebec-pi:~/EZBPi $ sudo mono ./EZBPi.exe -verbose
Raspberry EZBPi Version: 2019.8.27.1
Verbose logging is: True
Serial port is: /dev/serial0
EZB: TCP Started on port 23
EZ-B Server started on TCP Port: 23
Camera: TCP Started on port 24
Camera Server started on TCP Port: 24
Press ESC to quit
EZB: TCP Connection from: 127.0.0.1
Connection on TTY0
Ping
EZ-B v4 Command
Get CPU temp
Digital port 18 ON
Digital port 18 OFF
Digital port 18 ON
Digital port 18 OFF
TCP Server TTY0: System.Exception: Disconnected by remote host
at EZBPi.EZBProgram._TCPServer_OnConnection (System.Net.Sockets.TcpClient tcpClient, System.Net.Sockets.NetworkStream clientStream, System.Int32 id) [0x00032] in :0
EZB disconnected on tty:0

Here is what happens if I do the same but with the "read digital" control

Code:

EZB: TCP Connection from: 127.0.0.1
Connection on TTY1
Ping
EZ-B v4 Command
Get CPU temp
Return port 18 status
Return port 18 status
Return port 18 status
Return port 18 status
Return port 18 status
Return port 18 status
Return port 18 status
Digital port 18 ON
Return port 18 status
Return port 18 status
Return port 18 status
Return port 18 status
Return port 18 status
Return port 18 status
Digital port 18 ON
Return port 18 status
Return port 18 status
Return port 18 status
Return port 18 status
TCP Server TTY1: System.Exception: Disconnected by remote host
at EZBPi.EZBProgram._TCPServer_OnConnection (System.Net.Sockets.TcpClient tcpClient, System.Net.Sockets.NetworkStream clientStream, System.Int32 id) [0x00032] in :0
EZB disconnected on tty:1

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

Code:

pi@fredebec-pi:~ $ echo "18" > /sys/class/gpio/export
pi@fredebec-pi:~ $ echo "out" > /sys/class/gpio/gpio18/direction
pi@fredebec-pi:~ $ echo "1" > /sys/class/gpio/gpio18/value
pi@fredebec-pi:~ $ echo "0" > /sys/class/gpio/gpio18/value
and successfully switch on the led, without any interference or impact on the EZBPi server or EZ-Builder...