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. Hardware
  3. Odroid c1 as getaway?

Odroid c1 as getaway?

Scheduled Pinned Locked Moved Hardware
getawayraspberryodroid c1
14 Posts 3 Posters 3.5k Views 2 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.
  • D Offline
    D Offline
    dantefff
    wrote on last edited by
    #1

    I'm asking myself if it would be possible to use an odroid c1 (I have a spare one) as a getaway with direct connection to a NRF24L01+ (like raspberry or orange do)

    I think odroid c1 is quite compatible with raspberry gpios (wirepi works in it for example). I'm not expecting to work without modifications, but maybe someone has tried it yet and could save me some time.

    Have anyone tested it? Any advise to take in mind?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dantefff
      wrote on last edited by dantefff
      #2

      OK. I'm making small progress. Nothing amazing but I have not yet my nrf24. I'm using as base the orange pi zero getaway howto.
      As I can see spidev is now supported in mysensors so i did this untill now.

      • Installed Odrobian Jessie (Vanilla) from here: http://oph.mdrjr.net/odrobian/images/s805/
      • Loaded modules to work with spidev:
             $ modprobe spicc
             $ modprobe spidev
      
      • Installed gpio-admin to allow plain users to work with gpios from here: https://github.com/quick2wire/quick2wire-gpio-admin
      • Exported two pins (now 100 and 101, but I don't know if they are ok or if I need to use another ones) with
             # gpio-admin export 100 
             # gpio-admin export 101 
      
      • Configure Mysensors to use spidev and gpios 100 and 101 with
             # ./configure --spi-spidev-device=/dev/spidev0.0 \
              --my-transport=nrf24 --my-rf24-ce-pin=100 --my-rf24-cs-pin=101
      
      • Build Mysensors with make and test that the communication fails with the nrf24 module (obbious, there is no nrf24 module :blush: )
             # make
             # sudo ./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 FAIL
             mysgw: TSM:FAIL:CNT=1
             mysgw: TSM:FAIL:PDT
      

      And that's all until my module arrives

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dantefff
        wrote on last edited by
        #3

        @marceloaqno , as you are who made the orange pi how-to, and the code adaptation for spidev, maybe you can tell me if I'm on the right way

        M 1 Reply Last reply
        0
        • D dantefff

          @marceloaqno , as you are who made the orange pi how-to, and the code adaptation for spidev, maybe you can tell me if I'm on the right way

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

          @dantefff Nice. Let me know when your module arrives, and you start testing with it.

          D 1 Reply Last reply
          0
          • M marceloaqno

            @dantefff Nice. Let me know when your module arrives, and you start testing with it.

            D Offline
            D Offline
            dantefff
            wrote on last edited by
            #5

            @marceloaqno As expected, once receibed my nrf24, this does not work :-(
            Any options to debug this in an easy way?
            The nrf24 is working in a rpi1 so nrf24 is ok.

            pansenP 1 Reply Last reply
            0
            • D dantefff

              @marceloaqno As expected, once receibed my nrf24, this does not work :-(
              Any options to debug this in an easy way?
              The nrf24 is working in a rpi1 so nrf24 is ok.

              pansenP Offline
              pansenP Offline
              pansen
              wrote on last edited by
              #6

              @dantefff are you sure the pin numbers are correct? can you connect a LED and test if it's the right numbers?

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

              D 1 Reply Last reply
              0
              • pansenP pansen

                @dantefff are you sure the pin numbers are correct? can you connect a LED and test if it's the right numbers?

                D Offline
                D Offline
                dantefff
                wrote on last edited by
                #7

                @pansen Sure! What should I connect? If I connect leds to the spi pins should they blink? And what about the cs and ce pins?

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

                  Yes, an LED with a resistor. Then try to turn it on and off. But maybe that is not even necessary.

                  Besides, the pin numbers you mentioned seem quite odd, but I do not have experience with the C1.
                  Considering this image", your nrf24 has to be connected to header pins 19,21,23,1 for MOSI,MISO,SCK,3V3 and any GND one. Since you connected the two remaining ones on 100 and 101, try first to modify your configure to

                  ./configure --spi-spidev-device=/dev/spidev0.0 \
                          --my-transport=nrf24 --my-rf24-ce-pin=22 --my-rf24-cs-pin=21
                  

                  Which are the WiringPi pin numbers.

                  let me know if it works.

                  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
                  • D Offline
                    D Offline
                    dantefff
                    wrote on last edited by
                    #9

                    But 100 and 101 are export numbers. Does Mysensors use WiringPi numbers or Export numbers?

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

                      I don't know. Looked at the code, these are my conclusions:

                      RF24.cpp

                      LOCAL void RF24_csn(const bool level)
                      {
                      	hwDigitalWrite(MY_RF24_CS_PIN, level);
                      }
                      
                      LOCAL void RF24_ce(const bool level)
                      {
                      	hwDigitalWrite(MY_RF24_CE_PIN, level);
                      }
                      

                      MY_RF24_CS_PIN and MY_RF24_CE_PIN are supposedly set by ./configure

                      hwDigitalWrite leads to MyHwLinuxGeneric.cpp

                      
                      void hwDigitalWrite(uint8_t pin, uint8_t value)
                      {
                      	digitalWrite(pin, value);
                      }
                      

                      which leads to GPIO.cpp

                      void GPIO::digitalWrite(uint8_t pin, uint8_t value)
                      {
                      	FILE *f;
                      	char file[128];
                      
                      	if (pin > lastPinNum) {
                      		return;
                      	}
                      	if (0 == exportedPins[pin]) {
                      		pinMode(pin, OUTPUT);
                      	}
                      
                      	sprintf(file, "/sys/class/gpio/gpio%d/value", pin);
                      	f = fopen(file, "w");
                      
                      	if (value == 0)	{
                      		fprintf(f, "0\n");
                      	} else {
                      		fprintf(f, "1\n");
                      	}
                      
                      	fclose(f);
                      }
                      

                      As you can see, the pin numbers you chose have to coincide with the "file" mentioned here:

                      sprintf(file, "/sys/class/gpio/gpio%d/value", pin);
                      

                      If you're not sure, the already mentioned LED test can help by switching on/off the concerned "files".

                      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
                      • D Offline
                        D Offline
                        dantefff
                        wrote on last edited by
                        #11

                        Ok. It was as I expected. The pin numbers are right (export number is the one I need to use). I'll try the led in a feew minutes, but I have tested to get the value of that pins and it seems they are the correct ones. Maybe the error was to not especify pullup or pulldown value on the exported pins

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          dantefff
                          wrote on last edited by dantefff
                          #12

                          @pansen, @marceloaqno Led seems not to work in pin 100 so I changed to 115. In 115 led is lighted, but when I connect the RF24 I get the same error.
                          By the way, SPI pins (MOSI, MISO and SCLK) do not light any led, is this ok?

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

                            Yes, SPI pins should not light. I am at the end of my knowledge here, sorry. Next step would be connecting an oscilloscope to see it anything omes out the SPI interface and the selected pins.

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

                            D 1 Reply Last reply
                            0
                            • pansenP pansen

                              Yes, SPI pins should not light. I am at the end of my knowledge here, sorry. Next step would be connecting an oscilloscope to see it anything omes out the SPI interface and the selected pins.

                              D Offline
                              D Offline
                              dantefff
                              wrote on last edited by
                              #14

                              @pansen I have no oscilloscope near... Lets talk about it with Odroid community and hope someone could help me

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


                              10

                              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