Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Announcements
  3. 💬 Building a Orange Pi Gateway

💬 Building a Orange Pi Gateway

Scheduled Pinned Locked Moved Announcements
110 Posts 24 Posters 31.6k Views 21 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P pii

    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=915E6
    

    Whole 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
    
    pansenP Offline
    pansenP Offline
    pansen
    wrote on last edited by
    #95

    @pii

    • Does /sys/class/gpio/gpio24/direction exists?
    • Does /sys/class/gpio/gpio24 exists?
    • Can you write to them using echo?
    P 2 Replies Last reply
    0
    • pansenP pansen

      @pii

      • Does /sys/class/gpio/gpio24/direction exists?
      • Does /sys/class/gpio/gpio24 exists?
      • Can you write to them using echo?
      P Offline
      P Offline
      pii
      wrote on last edited by
      #96

      @pansen No.... nothing... /sys/class/gpio/gpio24doesn't exist.
      even "echo "24" > /sys/class/gpio/export doesn't work.
      But, yes otherwise if I try the same with 13 i.e "echo "13" > /sys/class/gpio/export Then a directory is created and then /sys/class/gpio/gpio24/direction do exist.

      1 Reply Last reply
      0
      • pansenP pansen

        @pii

        • Does /sys/class/gpio/gpio24/direction exists?
        • Does /sys/class/gpio/gpio24 exists?
        • Can you write to them using echo?
        P Offline
        P Offline
        pii
        wrote on last edited by
        #97

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

        1 Reply Last reply
        0
        • M Offline
          M Offline
          marceloaqno
          Code Contributor
          wrote on last edited by
          #98

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

          and run the make command again.

          P 1 Reply Last reply
          0
          • M marceloaqno

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

            and run the make command again.

            P Offline
            P Offline
            pii
            wrote on last edited by
            #99

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

            Thank you sooo much. I just did this. But, Now got a new error.

             ERROR Could not open /sys/class/gpio/gpio10/direction
            

            and when I tried to export pin 10 it says:

            :/sys/class/gpio# echo '10' > export
            -bash: echo: write error: Device or resource busy
            

            Though yes still I'm able to export/unexport pin 13(just for testing)

            M 1 Reply Last reply
            0
            • vladikomsV Offline
              vladikomsV Offline
              vladikoms
              wrote on last edited by
              #100

              @pii Try my library for Orange Pi Zero and Semtech SX1278 radio (RA-02 module)

              1 Reply Last reply
              0
              • P pii

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

                Thank you sooo much. I just did this. But, Now got a new error.

                 ERROR Could not open /sys/class/gpio/gpio10/direction
                

                and when I tried to export pin 10 it says:

                :/sys/class/gpio# echo '10' > export
                -bash: echo: write error: Device or resource busy
                

                Though yes still I'm able to export/unexport pin 13(just for testing)

                M Offline
                M Offline
                marceloaqno
                Code Contributor
                wrote on last edited by
                #101

                @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
                
                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  ghck
                  wrote on last edited by
                  #102

                  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?

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    ghck
                    wrote on last edited by
                    #103

                    More info: https://docs.armbian.com/User-Guide_Allwinner_overlays/

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      Roman
                      wrote on last edited by
                      #104

                      Hi!

                      Installation instructions will be adjusted for Armbian Stretch?

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        giaco456
                        wrote on last edited by
                        #105

                        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=0

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

                        1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          Roman
                          wrote on last edited by
                          #106

                          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=0

                          git clone https://github.com/mysensors/MySensors.git --branch development
                          cd MySensors
                          and further on the instructions

                          1 Reply Last reply
                          0
                          • pansenP Offline
                            pansenP Offline
                            pansen
                            wrote on last edited by pansen
                            #107

                            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=mysensors
                            

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

                            mfalkviddM 1 Reply Last reply
                            0
                            • pansenP Offline
                              pansenP Offline
                              pansen
                              wrote on last edited by
                              #108
                              This post is deleted!
                              1 Reply Last reply
                              0
                              • pansenP pansen

                                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=mysensors
                                

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

                                mfalkviddM Offline
                                mfalkviddM Offline
                                mfalkvidd
                                Mod
                                wrote on last edited by
                                #109

                                Thanks @pansen. I have replaced nrf24 with rf24 for all commands on the page and removed the -d option.

                                1 Reply Last reply
                                0
                                • OldSurferDudeO Offline
                                  OldSurferDudeO Offline
                                  OldSurferDude
                                  wrote on last edited by OldSurferDude
                                  #110

                                  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?

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  4

                                  Online

                                  11.7k

                                  Users

                                  11.2k

                                  Topics

                                  113.0k

                                  Posts


                                  Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • MySensors
                                  • OpenHardware.io
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular