💬 Building a Orange Pi Gateway
-
Am getting this error:
ERROR Could not open /sys/class/gpio/gpio24/direction
My config is:./configure --spi-spidev-device=/dev/spidev1.0 --my-node-id=1 --my-transport=rfm95 --my-rfm95-cs-pin=13 --my-rfm95-irq-pin=10 --my-rfm69-frequency=915E6Whole output is:
root@ttn-gateway:~/MySensors# sudo ./bin/mysgw May 23 09:37:31 INFO Starting gateway... May 23 09:37:31 INFO Protocol version - 2.3.0-alpha __ __ ____ | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ |___/ 2.3.0-alpha May 23 09:37:31 DEBUG MCO:BGN:INIT NODE,CP=RLNNL---,VER=2.3.0-alpha May 23 09:37:31 DEBUG TSM:INIT May 23 09:37:31 DEBUG TSF:WUR:MS=0 May 23 09:37:42 ERROR Could not open /sys/class/gpio/gpio24/direction -
Am getting this error:
ERROR Could not open /sys/class/gpio/gpio24/direction
My config is:./configure --spi-spidev-device=/dev/spidev1.0 --my-node-id=1 --my-transport=rfm95 --my-rfm95-cs-pin=13 --my-rfm95-irq-pin=10 --my-rfm69-frequency=915E6Whole output is:
root@ttn-gateway:~/MySensors# sudo ./bin/mysgw May 23 09:37:31 INFO Starting gateway... May 23 09:37:31 INFO Protocol version - 2.3.0-alpha __ __ ____ | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ |___/ 2.3.0-alpha May 23 09:37:31 DEBUG MCO:BGN:INIT NODE,CP=RLNNL---,VER=2.3.0-alpha May 23 09:37:31 DEBUG TSM:INIT May 23 09:37:31 DEBUG TSF:WUR:MS=0 May 23 09:37:42 ERROR Could not open /sys/class/gpio/gpio24/direction -
- Does /sys/class/gpio/gpio24/direction exists?
- Does /sys/class/gpio/gpio24 exists?
- Can you write to them using echo?
@pansen No.... nothing...
/sys/class/gpio/gpio24doesn't exist.
even "echo "24" > /sys/class/gpio/exportdoesn't work.
But, yes otherwise if I try the same with 13 i.e "echo "13" > /sys/class/gpio/exportThen a directory is created and then/sys/class/gpio/gpio24/directiondo exist. -
- Does /sys/class/gpio/gpio24/direction exists?
- Does /sys/class/gpio/gpio24 exists?
- Can you write to them using echo?
@pansen Thank you sooooooo much for your reply.!!! By the way, What I actually have to do is "Make an MQTT based LoRa(RA-02) receiver gateway on OrangePi Zero". And I'm stuck since whole week :'( of course spent time trying code without solid base. :/
Yes, yet I'm trying to first set up a LoRa receiver(not MQTT, not gateway) -
@pii --my-rfm95-cs-pin and --my-rfm95-irq-pin options are not currently supported by the configure script.
Until we fix this, could you please try adding the following to your examples_linux/mysgw.cpp (before the #include <MySensors.h>)#define MY_RFM95_CS_PIN 13 #define MY_RFM95_IRQ_PIN 10 #define MY_RFM95_FREQUENCY RFM95_915MHZand run the make command again.
-
@pii --my-rfm95-cs-pin and --my-rfm95-irq-pin options are not currently supported by the configure script.
Until we fix this, could you please try adding the following to your examples_linux/mysgw.cpp (before the #include <MySensors.h>)#define MY_RFM95_CS_PIN 13 #define MY_RFM95_IRQ_PIN 10 #define MY_RFM95_FREQUENCY RFM95_915MHZand run the make command again.
@marceloaqno said in 💬 Building a Orange Pi Gateway:
#define MY_RFM95_CS_PIN 13
#define MY_RFM95_IRQ_PIN 10
#define MY_RFM95_FREQUENCY RFM95_915MHZThank you sooo much. I just did this. But, Now got a new error.
ERROR Could not open /sys/class/gpio/gpio10/directionand when I tried to export pin 10 it says:
:/sys/class/gpio# echo '10' > export -bash: echo: write error: Device or resource busyThough yes still I'm able to export/unexport pin 13(just for testing)
-
@marceloaqno said in 💬 Building a Orange Pi Gateway:
#define MY_RFM95_CS_PIN 13
#define MY_RFM95_IRQ_PIN 10
#define MY_RFM95_FREQUENCY RFM95_915MHZThank you sooo much. I just did this. But, Now got a new error.
ERROR Could not open /sys/class/gpio/gpio10/directionand when I tried to export pin 10 it says:
:/sys/class/gpio# echo '10' > export -bash: echo: write error: Device or resource busyThough yes still I'm able to export/unexport pin 13(just for testing)
@pii Try to connect the IRQ pin from the radio to another GPIO on your Orange Pi, for example the GPIO2.
#define MY_RFM95_IRQ_PIN 2 -
There is an issue now with spi interfaces. With the current armbian image we are stuck at the prepare the system part, no /dev/spidev* available, the old method does not work. (There is no /boot/script.bin file, for example.) Does anyone know the solution, could this guide be updated, please?
-
-
I have Mysensors running with nrf24 , I wanted to upgrade Armbian to the latest Stretch. I configured DT overlays by adding
verbosity=1
console=serial
overlay_prefix=sun8i-h3
rootdev=UUID=bd0ded76-1188-4b52-a20a-64f326c1f193
rootfstype=ext4
overlays=w1-gpio uart1 i2c0 spi-spidev
param_w1_pin=PA20
param_w1_pin_int_pullup=1
param_uart1_rtscts=1
param_spidev_spi_bus=0to /boot/armbianEnv.txt. I had spidev working, but not the mysgw. It doidn't give me errors, but i was stuck at !TSM:INIT:TSP FAIL.
Maybe the problem is that there is no gpio-sunxi in Stretch... I have no idea.By the way, i noticed that the new version of Mysensors calls nrf24 transport differently, it is now called --my-transport=rf24.
Please update the guide for Armbian Stretch. -
Made fix for Armbian Stretch https://github.com/mysensors/MySensors/pull/1200.
my settings: /boot/armbianEnv.txt
overlays=w1-gpio uart1 spi-spidev spi-add-cs1
param_spidev_spi_bus=1
param_spidev_spi_cs=0git clone https://github.com/mysensors/MySensors.git --branch development
cd MySensors
and further on the instructions -
Hi,
for anyone creating a gateway on an Orange Pi PC using armbian mainline (4.x Kernel): The fex modifications are not necessary any more. As noted before by @Roman, the device tree needs to be modified.
If you use the exact same pins as in this guide for the Orange Pi PC, SPI0 needs to be activated instead of SPI1. (Pi Zero and PC are kind of pin compatible, but Zero only has SPI1 routed to the header, whereas the same pins on the PC have SPI0. On top, the Orange Pi PC also has SPI1 but on other pins):
verbosity=1 logo=disabled console=both disp_mode=1920x1080p60 overlay_prefix=sun8i-h3 overlays=w1-gpio uart1 spi-spidev spi-add-cs1 param_spidev_spi_bus=0 param_spidev_spi_cs=0 rootdev=<removed> rootfstype=ext4 usbstoragequirks=<removed>Attention: Header pin 26 is different between Pi PC and Pi Zero. On the zero it is PA10 but on the PC it is PA21. I connected the interrupt pin of the nrf24 like in the guide (header pin 26) and changed the configure command accordingly.
So the full command to use SPI0 and the interrupt connected to header pin 26 of the Orange Pi PC is:
./configure --spi-spidev-device=/dev/spidev0.0 --my-transport=rf24 --my-rf24-ce-pin=2 --my-rf24-cs-pin=13 --my-rf24-irq-pin=21 --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mysensorsThe rest of the guide is still valid, except that the transport is now called "rf24" instead of "nrf24". @mfalkvidd can you correct this maybe? Also, the -d switch seems to be not existing any more.
-
Hi,
for anyone creating a gateway on an Orange Pi PC using armbian mainline (4.x Kernel): The fex modifications are not necessary any more. As noted before by @Roman, the device tree needs to be modified.
If you use the exact same pins as in this guide for the Orange Pi PC, SPI0 needs to be activated instead of SPI1. (Pi Zero and PC are kind of pin compatible, but Zero only has SPI1 routed to the header, whereas the same pins on the PC have SPI0. On top, the Orange Pi PC also has SPI1 but on other pins):
verbosity=1 logo=disabled console=both disp_mode=1920x1080p60 overlay_prefix=sun8i-h3 overlays=w1-gpio uart1 spi-spidev spi-add-cs1 param_spidev_spi_bus=0 param_spidev_spi_cs=0 rootdev=<removed> rootfstype=ext4 usbstoragequirks=<removed>Attention: Header pin 26 is different between Pi PC and Pi Zero. On the zero it is PA10 but on the PC it is PA21. I connected the interrupt pin of the nrf24 like in the guide (header pin 26) and changed the configure command accordingly.
So the full command to use SPI0 and the interrupt connected to header pin 26 of the Orange Pi PC is:
./configure --spi-spidev-device=/dev/spidev0.0 --my-transport=rf24 --my-rf24-ce-pin=2 --my-rf24-cs-pin=13 --my-rf24-irq-pin=21 --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mysensorsThe rest of the guide is still valid, except that the transport is now called "rf24" instead of "nrf24". @mfalkvidd can you correct this maybe? Also, the -d switch seems to be not existing any more.
-
I saw this page and thought I give it a go. So I bought two OrangePi Zero 2. There's a lot of potential (WiFi) as a dedicated gateway. Currently the price is about US$20 on AliExpress (caveat emptor) There are a few flavors of Linux for it. I've dabbled with Armbian, Ubuntu and Debian
Another upside is that it doesn't draw a lot of current ~0.5A, though I haven't been successful in getting the radio to run (the reason for me being here) This is also a downside as I suspect the power supply needs to be very close to 5V. Thinking it was a power hog like the RPi, I used a 5V-3A supply. This supply operates on the principle that the load will pull down the voltage. There are dire warnings on the orangepi page about using cheap SD cards, but failed to mention that power supplies have to be matched, too.
It has a different CPU than the Orange Pi Zero non-2, the board that is used here.
Use the serial interface to configure the board. You're going to be doing all your configuration in a terminal, anyway, so you don't need a monitor or a keyboard. https://www.instructables.com/Setup-Orange-Pi-Using-Serial-Port/
The big downside is that the SPI interface is not supported. My research indicates that in order to get it to work one must jump through some serious hoops and being low on the learning curve, those hoops are probably out of my reach. https://forum.armbian.com/topic/21688-tips-on-configuring-double-spi-through-two-chipselects-on-orange-pi-zero-2/
The armbian OS has another big downside, WiFi is not supported. Putting a TP-Link nano router configured as a client works, but it's another $30! Why did they even release the OS?
So! Was anyone successful in getting the Orange Pi Zero 2 configured as a gateway?