France
Asked

Ezbpi Server - Access To The Pi Gpios

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

ARC Pro

Upgrade to ARC Pro

ARC Pro is your passport to a world of endless possibilities in robot programming, waiting for you to explore.

PRO
Canada
#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:

pi@fredebec-pi:~ $ cat /sys/firmware/devicetree/base/model
Raspberry Pi 4 Model B Rev 1.1pi@fredebec-pi:~ $ 
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

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";

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

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.

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: [email protected]
License: MIT
Location: /usr/lib/python2.7/dist-packages
Requires: 
Required-by: skywriter, rainbowhat, phatbeat, motephat, envirophat, Cap1xxx, blinkt, automationhat

PRO
Canada
#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

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

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

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 ARC...

#22  

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...

PRO
USA
#23  

@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.

#24  

@ptp

Cool, thanks. For sure, I am going to test it. See you on the other thread...:)