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.
  • hekH Offline
    hekH Offline
    hek
    Admin
    wrote on last edited by hek
    #1

    This thread contains comments for the article "Building a Orange Pi Gateway" posted on MySensors.org.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tag
      wrote on last edited by
      #2

      Hi!,

      Found a typo: ./condigure --spi-spidev-device=/dev/spidev1.0 ,should be configure

      Great work!! :thumbsup:

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

        @marceloaqno: I'm in the process of enabling SPI1 (and nrf24 subsequently) on the OPI Plus2e and it seems there are some hardware modifications necessary...I'd like to document on the way and when I am finished submit it somehow so it can be included here. Any suggestions for that?

        Orange Pi Plus 2e connected to nrf24 PA via SPI running git-development MySensors gateway, OpenHAB2, mosquitto and MySQL persistence.

        M 1 Reply Last reply
        1
        • pansenP pansen

          @marceloaqno: I'm in the process of enabling SPI1 (and nrf24 subsequently) on the OPI Plus2e and it seems there are some hardware modifications necessary...I'd like to document on the way and when I am finished submit it somehow so it can be included here. Any suggestions for that?

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

          @pansen You could document your steps here and I'll update the building guide. If changes to the code are required, please send a PR to the development branch.

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

            @marceloaqno: ok so here are my conclusions:
            After going through the schematics of the OPi Plus2e I realized that the H3 has dedicated pins for NAND/eMMC, which is probably not the case for the H2+ in the OPi zero. They used the pins of SPI1 for a status LED and a "MUTE" net, which is not connected anywhere so at first I was like "wtf?"...
            So, the SPI0 is free for usage out of the box and the .fex does not need to be modified. Summed up:

            If the OPi to be used has "SPI0" in the GPIO header, no .fex modifications are necessary. CE and CN/CS/CSN pin can be chosen freely (?), I picked it like this:
            ce - gray - pa13 - PHYSICAL pin8 - LOGICAL pin13 (1-1)*32 + 13
            cn - blue - pa14 - PHYSICAL pin10 - LOGICAL pin14 (1-1)*32 + 14
            If another pin is chosen, the pin number can be calculated with that formula: (position of letter in alphabet - 1) * 32 + pin number (from: https://linux-sunxi.org/GPIO)
            The pinout of the connector can be found here: https://linux-sunxi.org/Xunlong_Orange_Pi_Plus_2E#Expansion_Port (SPI0 pins are PC0-PC2 or 19,21,23)
            After connecting the physical pins 8,10,19,21 and 23 to the nrf24 (and pin 1 for 3.3v), following command was sufficient to set up mysgw and get the nrf24 to respond:
            ./configure --spi-spidev-device=/dev/spidev0.0 --my-transport=nrf24 --my-rf24-ce-pin=13 --my-rf24-cs-pin=14

            Orange Pi Plus 2e connected to nrf24 PA via SPI running git-development MySensors gateway, OpenHAB2, mosquitto and MySQL persistence.

            S 1 Reply Last reply
            2
            • L Offline
              L Offline
              lecintre
              wrote on last edited by
              #6

              hello
              I build this and work great for my OrangePI PC+ but I do not know how to integrate it in domoticz???
              Can you help me please
              thank's for you good work

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

                @lecintre: I just installed domoticz and I could enable my gateway by clicking on "please setup your Hardware" in the start screen, then selecting "mysensors gateway with lan interface" with the lan ip of my orange pi (but i guess 127.0.0.1 would also work) and port 5003.
                this should appear then:
                mysensors_lan_gw Yes MySensors Gateway with LAN interface
                Version: 2.2.0-beta Setup 0.0.0.0 5003 Disabled

                clicking on "Setup" then leads to a menu where i see my first test node:

                NodeID
                Name
                Sketch Name
                Version
                Children
                Last Seen
                0 Unknown Unknown 1.0 1 2017-01-29 20:27:28
                1 Unknown nrf24LEDtest 1.0 2 2017-01-29 20:28:27

                let me know if that works out for you

                Orange Pi Plus 2e connected to nrf24 PA via SPI running git-development MySensors gateway, OpenHAB2, mosquitto and MySQL persistence.

                1 Reply Last reply
                1
                • L Offline
                  L Offline
                  lecintre
                  wrote on last edited by
                  #8

                  @pansen: Thank you very much it works very well.
                  Cool for your help
                  thank you so much
                  For you which is the best domoticz or jeedom ?? With mysensors protocol

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

                    @lecintre: avec plaisir :) I only compared OpenHAB and domoticz so far. Domoticz worked out of the box with the nrf24 but does not have support for my 5.1 receiver (which OpenHAB does). Jeedom looks to commercial (for example no free app+controller) for my taste and there seems to be no community. A good starting point for me was the popularity of each controller in this forum: https://forum.mysensors.org/category/3/controllers

                    I guess it really depends on your application, if you only have DYI sensors and actuators, domoticz is probably enough.

                    Orange Pi Plus 2e connected to nrf24 PA via SPI running git-development MySensors gateway, OpenHAB2, mosquitto and MySQL persistence.

                    1 Reply Last reply
                    0
                    • YveauxY Offline
                      YveauxY Offline
                      Yveaux
                      Mod
                      wrote on last edited by
                      #10

                      @marceloaqno Great job man!
                      Looking at the radio connection, there is a 5V -> 3V3 conversion layed out.
                      The Pi Zero Schematics sheet 7-D1, 7-B5 and 11-D4 indicate VCC3V3-EXT is present on pin 1 of the IO connector and internally connected to VCC-IO, which can supply 1A @ 3V3.
                      Don't you think there is enough margin to supply the nRF24 directly from VCC3V3-EXT?

                      http://yveaux.blogspot.nl

                      M 1 Reply Last reply
                      0
                      • YveauxY Yveaux

                        @marceloaqno Great job man!
                        Looking at the radio connection, there is a 5V -> 3V3 conversion layed out.
                        The Pi Zero Schematics sheet 7-D1, 7-B5 and 11-D4 indicate VCC3V3-EXT is present on pin 1 of the IO connector and internally connected to VCC-IO, which can supply 1A @ 3V3.
                        Don't you think there is enough margin to supply the nRF24 directly from VCC3V3-EXT?

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

                        @Yveaux Yes, more than enough :smile: . Thanks and thanks for pointing that out.

                        1 Reply Last reply
                        0
                        • scalzS Offline
                          scalzS Offline
                          scalz
                          Hardware Contributor
                          wrote on last edited by scalz
                          #12

                          i've not checked yet, i miss time for trying the linux port :blush: but i'm curious to know if this power supply would be noisy..which may need a ferrite and capas, else radio could have a bad snr and less range/sensitiviy. Maybe i'm wrong.. i'll try to scope when i'll have some time, or if i remember about it lol!

                          1 Reply Last reply
                          0
                          • pansenP pansen

                            @marceloaqno: ok so here are my conclusions:
                            After going through the schematics of the OPi Plus2e I realized that the H3 has dedicated pins for NAND/eMMC, which is probably not the case for the H2+ in the OPi zero. They used the pins of SPI1 for a status LED and a "MUTE" net, which is not connected anywhere so at first I was like "wtf?"...
                            So, the SPI0 is free for usage out of the box and the .fex does not need to be modified. Summed up:

                            If the OPi to be used has "SPI0" in the GPIO header, no .fex modifications are necessary. CE and CN/CS/CSN pin can be chosen freely (?), I picked it like this:
                            ce - gray - pa13 - PHYSICAL pin8 - LOGICAL pin13 (1-1)*32 + 13
                            cn - blue - pa14 - PHYSICAL pin10 - LOGICAL pin14 (1-1)*32 + 14
                            If another pin is chosen, the pin number can be calculated with that formula: (position of letter in alphabet - 1) * 32 + pin number (from: https://linux-sunxi.org/GPIO)
                            The pinout of the connector can be found here: https://linux-sunxi.org/Xunlong_Orange_Pi_Plus_2E#Expansion_Port (SPI0 pins are PC0-PC2 or 19,21,23)
                            After connecting the physical pins 8,10,19,21 and 23 to the nrf24 (and pin 1 for 3.3v), following command was sufficient to set up mysgw and get the nrf24 to respond:
                            ./configure --spi-spidev-device=/dev/spidev0.0 --my-transport=nrf24 --my-rf24-ce-pin=13 --my-rf24-cs-pin=14

                            S Offline
                            S Offline
                            SdeWeb
                            wrote on last edited by SdeWeb
                            #13

                            @pansen Hi, Please could you confirm your pin connection beetween NRF24L01 and the Opi Plus2E, il followed your setup inctruction (no .fex modification and your specific ./configure), but mine don't work, i got this error "mysgw: Could not open /sys/class/gpio/gpio13/direction".

                            I connected my NRF24L01 on OPI P2E like this :

                            • NRF Port Name / (N°) ------- OPI Port (N°) / Name
                              • GND (1) <------------> (6) GND
                              • VCC (2) <------------> (17) 3.3V PWR
                              • CE (3) <---------------> (8)
                              • CSN (4) <------------> (10)
                              • SCK (5) <-------------> (23)
                              • MOSI (6) <-----------> (19) MOSI
                              • MISO (7) <-----------> (21) MISO
                              • IRQ (8) <---------------> NC

                            Thanks.
                            Seb.

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

                              Hi @SdeWeb header pins 8 and 10 are used by some other hardware (SPI1, UART3) which might need to be deactivated in the .fex in your system, for me it worked straight away so that would be weird..just check the .fex if SPI1 and UART3 are indeed disabled.

                              It looks like the definitions for the GPIO are faulty, you could try a LED test to see if they work at all. If the problem persists rather open a topic in the Development sub forum 8) Or, pick another GPIO, for example header pins 14 and 16.

                              Orange Pi Plus 2e connected to nrf24 PA via SPI running git-development MySensors gateway, OpenHAB2, mosquitto and MySQL persistence.

                              1 Reply Last reply
                              0
                              • W Offline
                                W Offline
                                Wascht'l
                                wrote on last edited by
                                #15

                                Hello,
                                would it be possible to add the wiring for the RS485-Modules, please?
                                will it be similar to the Raspberry Pi?
                                Thank you. Waschtl.

                                S 1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  SdeWeb
                                  wrote on last edited by SdeWeb
                                  #16

                                  Hi,
                                  Well done finally i used the dedicated .fex file for Orange Pi Plus 2E here :
                                  https://linux-sunxi.org/Xunlong_Orange_Pi_Plus_2E#Expansion_Port

                                  at this point :
                                  https://github.com/igorpecovnik/lib/blob/master/config/fex/orangepiplus2e.fex

                                  Read the .fex file in a text editor, u'll see important things about "gpio_config" for H3 cpu :

                                  ; NOTE: This section is necessary only for "gpio_sunxi" driver
                                  ; which is obsolete for H3 boards
                                  [gpio_para]
                                  gpio_used = 0
                                  gpio_num = 0
                                  

                                  I connected my NRF24L01 on OPI P2E like this :

                                  NRF24L01 Port Name / (Pin N°) ----- OPI Port (Pin N°) / Name
                                                        GND (1)  <-----------> (20) / GND
                                                        VCC (2)  <-----------> (17) / 3.3V PWR
                                                        CE (3)   <-----------> (22) / (PA2 / GPIO2)
                                                        CSN (4)  <-----------> (24) / (PC3 / GPIO67)
                                                        SCK (5)  <-----------> (23)
                                                        MOSI (6) <-----------> (19) MOSI
                                                        MISO (7) <-----------> (21) MISO
                                                        IRQ (8)  <-----------> NC
                                  

                                  So "MySensors" setup is :

                                  ./configure --spi-spidev-device=/dev/spidev0.0 --my-transport=nrf24 --my-rf24-ce-pin=2 --my-rf24-cs-pin=67
                                  

                                  Then

                                  ./bin/mysgw -d
                                  

                                  Return :

                                  root@orangepiplus2e:~/MySensors# ./bin/mysgw -d
                                  mysgw: Starting gateway...
                                  mysgw: Protocol version - 2.2.0-beta
                                  mysgw: MCO:BGN:INIT GW,CP=RNNG---,VER=2.2.0-beta
                                  mysgw: TSM:INIT
                                  mysgw: TSF:WUR:MS=0
                                  mysgw: TSM:INIT:TSP OK
                                  mysgw: TSM:INIT:GW MODE
                                  mysgw: TSM:READY:ID=0,PAR=0,DIS=0
                                  mysgw: MCO:REG:NOT NEEDED
                                  mysgw: Listening for connections on 0.0.0.0:5003
                                  mysgw: MCO:BGN:STP
                                  mysgw: MCO:BGN:INIT OK,TSP=1
                                  

                                  Best.
                                  Seb.

                                  E 1 Reply Last reply
                                  1
                                  • W Wascht'l

                                    Hello,
                                    would it be possible to add the wiring for the RS485-Modules, please?
                                    will it be similar to the Raspberry Pi?
                                    Thank you. Waschtl.

                                    S Offline
                                    S Offline
                                    SdeWeb
                                    wrote on last edited by
                                    #17

                                    @Wascht'l Hi,
                                    Take a look here, to get some idea :

                                    https://fr.pinout.xyz/pinout/rs485_pi#

                                    Regards.

                                    1 Reply Last reply
                                    1
                                    • R Offline
                                      R Offline
                                      Reza
                                      wrote on last edited by Reza
                                      #18

                                      i have problem :/
                                      what about this :

                                      
                                      root@orangepione:~/MySensors# ./configure --spi-spidev-device=/dev/spidev0.0 --my-transport=nrf24 --my-rf24-ce-pin=2 --my-rf24-cs-pin=13                       
                                       -bash: ./configure: Permission denied
                                      root@orangepione:~/MySensors#
                                      
                                      
                                      T 1 Reply Last reply
                                      0
                                      • R Reza

                                        i have problem :/
                                        what about this :

                                        
                                        root@orangepione:~/MySensors# ./configure --spi-spidev-device=/dev/spidev0.0 --my-transport=nrf24 --my-rf24-ce-pin=2 --my-rf24-cs-pin=13                       
                                         -bash: ./configure: Permission denied
                                        root@orangepione:~/MySensors#
                                        
                                        
                                        T Offline
                                        T Offline
                                        Tag
                                        wrote on last edited by Tag
                                        #19

                                        @Reza
                                        Seems your ./configure script is not executable... try:

                                        chmod 755 ./configure
                                        
                                        R 1 Reply Last reply
                                        0
                                        • T Tag

                                          @Reza
                                          Seems your ./configure script is not executable... try:

                                          chmod 755 ./configure
                                          
                                          R Offline
                                          R Offline
                                          Reza
                                          wrote on last edited by
                                          #20

                                          @Tag

                                          root@orangepione:~/MySensors# chmod 755 ./configure
                                          root@orangepione:~/MySensors# chmod 755 ./configure --spi-spidev-device=/dev/spidev1.0 --my-transport=nrf24 --my-rf24-ce-pin=2 --my-rf24-cs-pin=13
                                          chmod: unrecognized option '--spi-spidev-device=/dev/spidev1.0'
                                          Try 'chmod --help' for more information.
                                          root@orangepione:~/MySensors#
                                          
                                          S 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          18

                                          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