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
T

Tag

@Tag
About
Posts
54
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • 💬 Building a Orange Pi Gateway
    T Tag

    @Reza

    try this:

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

    See this page for your header pinout: http://linux-sunxi.org/Orange_Pi_One#Orientation_of_the_GPIO_header

    the --my-rf24-cs-pin= is key to have it right on your system

    Announcements

  • Mysensors Gateway on OrangePi (Zero) (opi)
    T Tag

    @marceloaqno

    Hi!!, many thanks for the info!! really helpful!
    Made some progress. first I created this table based on this page: http://linux-sunxi.org/GPIO

    Pin - Num - Name - Calculated value A=1 ((1-1)*32 + Pin)
    CE / 22 / PA02 / 2
    SCK / 23 / PA14 / 14
    MISO / 21 / PA16 / 16
    CSN / 24 / PA13 / 13
    MOSI / 19 / PA15 / 15

    Now it is important that you know which kernel is used on your systems the 4.x architecture is different compared to the 3.x arch...

    If the 4.x kernel is used you need to use the calculated value for the GPIO pin numbering, i could not test that since I am using the 3.x kernel, so this is what i did:

    1. load the GPIO kernel module:
    modprobe gpio-sunxi
    
    1. Create the GPIO device files since these were not available on my system by default.
    for A in 1 2 3 4 5 6 7 8 9 10 11 12; do echo "$A" > /sys/class/gpio/export ; done
    

    This created the following entries in /sys/class/gpio

    root@orangepizero:~/marceloaqno-spidev/bin# ls -l /sys/class/gpio
    total 0
    --w------- 1 root root 4096 Jan  8 07:39 export
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio1 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio1
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio11 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio11
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio12 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio12
    lrwxrwxrwx 1 root root    0 Jan  8 07:32 gpio13 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio13
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio2 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio2
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio3 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio3
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio4 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio4
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio5 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio5
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio6 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio6
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio7 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio7
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio8 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio8
    lrwxrwxrwx 1 root root    0 Jan  8 07:16 gpio9 -> ../../devices/platform/sunxi-pinctrl/gpio/gpio9
    lrwxrwxrwx 1 root root    0 Jan  1  1970 gpiochip0 -> ../../devices/platform/sunxi-pinctrl/gpio/gpiochip0
    --w------- 1 root root 4096 Jan  1  1970 unexport
    

    Modified mysgw.cpp to use:

    #define MY_RF24_CE_PIN 2
    #define MY_RF24_CS_PIN 13
    

    And did a clean build:

    make clean
    ./configure
    make
    

    Now some thing has changed! :)

    root@orangepizero:~/marceloaqno-spidev/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
    

    Will do some more testing with an LED today see if the GPIO pin numbering that was created is okay,

    will keep you posted!:

    Development

  • beta testers required for MyController 0.0.3-alpha1 release
    T Tag

    @jkandasa said:

    sed on our community member

    Just tested the common services script, works like a charm, best thing is, forecast is Sunny!! :)

    MyController.org mycontroller.org

  • 💬 Building a Orange Pi Gateway
    T Tag

    Hi!,

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

    Great work!! :thumbsup:

    Announcements

  • Mysensors Gateway on OrangePi (Zero) (opi)
    T Tag

    Hi All,

    I put together the steps to get MySensors running on the OrangePi Zero:
    Take note of the SPI part, 1 typo and you will not see /dev/spidev1.0

    • Download and Install the ARMbian(debian) OS image
      https://www.armbian.com/orange-pi-zero/

    • Install sunxi-tools:
      These tools are required to make changes in the boot area of the system

    sudo apt-get update
    sudo apt-get install sunxi-tools
    
    • How to add /dev/spidev1.0 (which is required since /dev/spidev0.0 is used for the onboard NAND flash)
    cd /boot
    bin2fex /boot/script.bin /root/myscript.txt
    

    Now edit /root/myscript.bin and add/change the following so it looks exactly like the part below:

    [spi0]
    spi_used = 1
    spi_cs_bitmap = 1
    spi_mosi = port:PC00<3><default><default><default>
    spi_miso = port:PC01<3><default><default><default>
    spi_sclk = port:PC02<3><default><default><default>
    spi_cs0 = port:PC03<3><1><default><default>
    	
    [spi1]
    spi_used = 1
    spi_cs_bitmap = 1
    spi_cs0 = port:PA13<2><1><default><default>
    spi_sclk = port:PA14<2><default><default><default>
    spi_mosi = port:PA15<2><default><default><default>
    spi_miso = port:PA16<2><default><default><default>
    	
    [spi_devices]
    spi_dev_num = 2
    	
    [spi_board0]
    modalias = "spidev"
    max_speed_hz = 33000000
    bus_num = 0
    chip_select = 0
    mode = 0
    full_duplex = 1
    manual_cs = 0
    	
    [spi_board1]
    modalias = "spidev"
    max_speed_hz = 33000000
    bus_num = 1
    chip_select = 0
    mode = 0
    full_duplex = 1
    manual_cs = 0
    
    • Then recompile the script file:
    fex2bin /root/myscript.txt /boot/script.bin
    

    Reboot the system

    reboot
    

    2 device files should exist now:

    root@orangepizero:~# ls -l /dev/spi*
    crw------- 1 root root 153, 0 Jan 11 16:31 /dev/spidev0.0
    crw------- 1 root root 153, 1 Jan 11 16:31 /dev/spidev1.0
    

    Load the gpio module

    modprobe gpio-sunxi
    

    To load the module gpio-sunxi automagically load at boot time, add gpio-sunxi to /etc/modules

    echo gpio-sunxi >> /etc/modules
    
    • Now it is time to install the GW.
    cd /root
    git clone https://github.com/marceloaqno/MySensors.git orangepi 
    cd orangepi/ 
    git pull origin spidev
    ./configure --spi-spidev-device=/dev/spidev1.0
    make
    

    Working like a charm!

    If you tested "/bin/mysgw -d" and all works as expected, make the installation permanent:

    make install
    

    Additional
    If you want to read data into a controller using a device file (i.e Mycontroller) use the build string below

     ./configure --spi-spidev-device=/dev/spidev1.0  --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyMySensorsGateway
    

    Hope this helps!! have fun!!

    Development

  • MyController on OrangePi
    T Tag

    @mihai.aldea:

    Agree!, mycontroller runs perfectly on an OrangePI!
    In my case i use an Orange Pi Zero, with 512MB memory, it is a quadcore CPU, which seven seems to be over dimentioned for the job :)

    If you use Armbian, installing Java is pretty simple,

    Steps i used:
    sudo echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
    sudo echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
    sudo apt-get update
    sudo apt-get install oracle-java8-installer

    Once all is installed:

    sudo apt-get install oracle-java8-set-default

    See this page for all information http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

    Hope it helps!

    Kind regards,

    Tag

    (Visit http://www.mycontroller.org/ for this great piece of software!)

    MyController.org

  • 💬 Building a Orange Pi Gateway
    T Tag

    @Reza

    Are you sure your git environment is okay?
    Maybe do a fresh git pull for mysensors?
    See the howto on the orangePI page just follow from the start.... I have serious questions that your env is correct since configure was not executable....

    Announcements

  • 💬 Building a Orange Pi Gateway
    T Tag

    @Reza
    You must use the OrangePI instructions, these are different conmpared to the RaspberryPI instructions
    Thx SdeWeb!, same toughts!! :)

    Announcements

  • 💬 Building a Orange Pi Gateway
    T Tag

    @Reza

    I do not have the OPI One HW available..... so that will be a problem.
    you need to start reading the OPI documentation, and see if the pinout you are using is correct, I know for example that OPI Zero used the SPI1 channel since SPI0 is used for the NAND flash. now it might be that the OPI One does not have the NAND flash so you can use the SPI0 channel.

    Try to start here

    or here

    If you read carefully you will see that pin 19-21-23 are on the opi ONE SPI0, and on the OPI Zero SPI1.....

    This is the OPI Zero page: http://linux-sunxi.org/Orange_Pi_Zero#Orientation_of_the_GPIO_header

    ANd the OPI One page:
    http://linux-sunxi.org/Orange_Pi_One#Orientation_of_the_GPIO_header

    @marceloaqno helped build this for the OPI Zero.... and SPI was an important part to get this working...

    Try this:

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

    worth a try if you use SPI0, and GPIO3 for the CE pin (on the ONE the ce SPI0 pin is 3 according to the wiki page)

    Announcements
  • Login

  • Don't have an account? Register

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