Navigation

    • Register
    • Login
    • Search
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. marceloaqno
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    marceloaqno

    @marceloaqno

    Code Contributor

    84
    Reputation
    206
    Posts
    2682
    Profile views
    3
    Followers
    0
    Following
    Joined Last Online
    Website github.com/marceloaqno Location Brazil

    marceloaqno Follow
    Mod Code Contributor

    Best posts made by marceloaqno

    • RE: MySensors Raspberry port suggestions

      This is the initial support for Linux/RaspberryPi for the 2.0:
      https://github.com/marceloaqno/Arduino/tree/dev-raspberrypi

      Supports:

      • RF24 radio
      • Ethernet gateway
      • Store "eeprom" to a file (thanks to @aaron832 )
      • MQTT (thanks to @aaron832 )
      • Can be compiled in a linux machine other than Pi

      To be implemented:

      • Store "eeprom" to a file
      • Serial
      • MQTT
      • RF24 interrupts
      • UDP
      • Act as a client to connect to a controller

      I haven't extensively test it, so there are probably some bugs. Any suggestions or ideas for improvement are welcome.

      posted in Development
      marceloaqno
      marceloaqno
    • Debug messages over Wi-Fi

      I wrote a library to be able to watch the debug messages from a ethernet gateway over Wi-Fi (or ethernet).
      It opens port 2300, so you can connect with putty (change the "Connection type" to Telnet or Raw).

      If anyone is interested, here is the code: https://github.com/marceloaqno/MyNetDebug

      To use it, add the following lines in your sketch before MySensors.h

      #include <MyNetDebug.h>
      #define MY_SERIALDEVICE NetDebug
      

      And into your loop function:

      void loop()
      {
        (void)NetDebug.available();
        ...
      

      For more details, please check the examples.

      posted in Development
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      @otto001 I think I found the problem. I wrote a fix for it:
      https://github.com/marceloaqno/MySensors/commit/ca8865d8e1fe1b08195943fae1640d5fddb81924

      0 marceloaqno committed to marceloaqno/MySensors
      Linux: Fix stability problem with ethernet
      
      Fix a problem where mysgw stops working and consumes a lot of cpu.
      posted in Announcements
      marceloaqno
      marceloaqno
    • MySensors Raspberry port suggestions

      In an attempt to keep mysensors/Raspberry repository in sync with mysensors/Arduino, I started a while ago working on a solution but only recently had time to finish.
      I ended up with two approaches:

      Place the raspberry gateway files in a directory called examples_RPi within the libraries\MySensors folder (more or less like TMRh20/RF24 does)
      https://github.com/marceloaqno/Arduino/tree/raspberry-gateway

      or keep the two repos and use git subtree to bind them:
      https://github.com/marceloaqno/Raspberry/tree/experimental

      What you guys thinks?

      I'm trying to catch up with new changes into the development branch and thinking of a way to port this into it.

      posted in Development
      marceloaqno
      marceloaqno
    • RE: Mysensors Gateway on OrangePi (Zero) (opi)

      I created the draft for the official article: https://www.mysensors.org/build/orange

      posted in Development
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      @frencho I hope to write something this weekend, at least a draft.

      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: MySensors Raspberry port suggestions

      @raptorjr PiDome should work now (https://forum.mysensors.org/topic/2389/added-support-for-local-mysensors-rpi-direct-radio-connection).

      You need to add --my-serial-is-pty when running ./configure or uncomment the line #define MY_IS_SERIAL_PTY in mysGateway.cpp.

      posted in Development
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      The RPi port has just received a new update that changes some important things related to the location and name of the gateway binary and services:

      mysGateway was renamed to mysgw
      mysgateway service was renamed to mysgw

      Now, after successfully running the make command, you will find the gateway file under ./bin/mygw

      Also, before installing the new version you need to manually remove the old one:

      If you are using systemd

      sudo systemctl disable mysgateway.service
      sudo rm /etc/systemd/system/mysgateway.service
      sudo rm /usr/local/bin/mysGateway
      

      If you are using sysvinit

      sudo update-rc.d -f mysgateway remove
      sudo rm /etc/init.d/mysgateway
      sudo rm /usr/local/bin/mysGateway
      
      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: MySensors Raspberry port suggestions

      Add some options to the gateway execution:

      # ./examples_linux/mysGateway -h
      Usage: mysGateway [options]
      
      Options:
      -h            Display a short summary of all program options.
      -d            Enable debug.
      -b            Become a daemon.
      

      Debug is now disabled by default.
      You can't run it as a linux daemon if debug is enabled.
      When daemonized all messages will be print to syslog.

      posted in Development
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      @gohan There is a open github pull request very similar to what @macvictor proposed, but for now I recommend using the examples_linux/mysgw.cpp file.

      posted in Announcements
      marceloaqno
      marceloaqno

    Latest posts made by marceloaqno

    • RE: 💬 Building a Raspberry Pi Gateway

      @ricorico94 to update your install run:

      sudo make install
      sudo systemctl restart mysgw.service
      
      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Orange Pi Gateway

      @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
      
      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Orange Pi 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_915MHZ
      

      and run the make command again.

      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      The two patches to fix ethernet stability have been merger into the development branch, and also some changes to the gateway logging. I updated the build instructions to reflect the changes.

      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      @masmat This is my mosquitto.log

      1521680648: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting
      1521680648: Config loaded from /etc/mosquitto/mosquitto.conf.
      1521680648: Opening ipv4 listen socket on port 1883.
      1521680648: Opening ipv6 listen socket on port 1883.
      1521762617: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
      1521763549: New connection from 127.0.0.1 on port 1883.
      1521763549: New client connected from 127.0.0.1 as mygateway1 (c1, k15, u'rpi').
      

      A socket error message:

      1521764339: Socket error on client mygateway1, disconnecting.
      

      shows only if I stop/exit mysgw.

      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      @gohan Sorry to hear that, mysgw doesn't change any system files, a simple reboot and rebuild of the gateway should be enough to resume communication in a case of more serious error.

      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      @mvader The gateway will respond with an I_VERSION every time a controller connected to port 5003 sends an I_VERSION request.

      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      @masmat I did a test with the following configuration:

      • Raspberry Pi 1 with Raspbian (2017-11-29-raspbian-stretch-lite)

        pi@raspberrypi:~/MySensors $ lsb_release -a
        No LSB modules are available.
        Distributor ID: Raspbian
        Description:    Raspbian GNU/Linux 9.1 (stretch)
        Release:        9.1
        Codename:       stretch
        
      • MySensors master branch - Protocol version - 2.2.0

        ./configure --my-transport=nrf24 --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=m ygateway1 --my-mqtt-user=rpi --my-mqtt-password=password
        
      • Mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) [installed from apt-get]

        pi@raspberrypi:~/MySensors $ cat /etc/mosquitto/mosquitto.conf
        # Place your local configuration in /etc/mosquitto/conf.d/
        #
        # A full description of the configuration file is at
        # /usr/share/doc/mosquitto/examples/mosquitto.conf.example
        
        pid_file /var/run/mosquitto.pid
        
        persistence true
        persistence_location /var/lib/mosquitto/
        
        log_dest file /var/log/mosquitto/mosquitto.log
        
        allow_anonymous false
        password_file /etc/mosquitto/passwordfile
        
        include_dir /etc/mosquitto/conf.d
        

        Added the mosquitto user (user=rpi, password=password) with:

        sudo mosquitto_passwd -c /etc/mosquitto/passwordfile rpi
        

      It didn't show any error to connect to the MQTT broker:

      pi@raspberrypi:~/MySensors $ sudo ./bin/mysgw -d
      mysgw: Starting gateway...
      mysgw: Protocol version - 2.2.0
      mysgw: MCO:BGN:INIT GW,CP=RNNGL---,VER=2.2.0
      mysgw: TSF:LRT:OK
      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: MCO:BGN:STP
      mysgw: MCO:BGN:INIT OK,TSP=1
      mysgw: GWT:RMQ:MQTT RECONNECT
      mysgw: connected to 127.0.0.1
      mysgw: GWT:RMQ:MQTT CONNECTED
      mysgw: GWT:TPS:TOPIC=mysensors-out/0/255/0/0/18,MSG SENT
      mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
      mysgw: TSF:MSG:PINGED,ID=5,HP=1
      mysgw: TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
      mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=32,pt=5,l=4,sg=0:500
      mysgw: GWT:TPS:TOPIC=mysensors-out/5/255/3/0/32,MSG SENT
      mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=33,pt=5,l=4,sg=0:4951
      mysgw: GWT:TPS:TOPIC=mysensors-out/5/255/3/0/33,MSG SENT
      mysgw: TSF:MSG:READ,5-5-0,s=1,c=1,t=37,pt=4,l=4,sg=0:36053
      mysgw: GWT:TPS:TOPIC=mysensors-out/5/1/1/0/37,MSG SENT
      mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=32,pt=5,l=4,sg=0:500
      mysgw: GWT:TPS:TOPIC=mysensors-out/5/255/3/0/32,MSG SENT
      mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=33,pt=5,l=4,sg=0:5000
      mysgw: GWT:TPS:TOPIC=mysensors-out/5/255/3/0/33,MSG SENT
      mysgw: TSF:MSG:READ,5-5-0,s=1,c=1,t=37,pt=4,l=4,sg=0:36055
      mysgw: GWT:TPS:TOPIC=mysensors-out/5/1/1/0/37,MSG SENT
      mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=32,pt=5,l=4,sg=0:500
      mysgw: GWT:TPS:TOPIC=mysensors-out/5/255/3/0/32,MSG SENT
      mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=33,pt=5,l=4,sg=0:5000
      mysgw: GWT:TPS:TOPIC=mysensors-out/5/255/3/0/33,MSG SENT
      mysgw: TSF:MSG:READ,5-5-0,s=1,c=1,t=37,pt=4,l=4,sg=0:36055
      mysgw: GWT:TPS:TOPIC=mysensors-out/5/1/1/0/37,MSG SENT
      
      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      @gieljnssns One way is to replace the changed files, in this case EthernetServer.cpp for the first patch and EthernetClient.cpp for the second patch.

      You can download from:
      https://raw.githubusercontent.com/marceloaqno/MySensors/linux-fix-stability/drivers/Linux/EthernetServer.cpp
      https://raw.githubusercontent.com/marceloaqno/MySensors/linux-fix-stability/drivers/Linux/EthernetClient.cpp

      Here is a step-by-step:

      git clone https://github.com/mysensors/MySensors.git
      cd MySensors
      curl https://raw.githubusercontent.com/marceloaqno/MySensors/linux-fix-stability/drivers/Linux/EthernetServer.cpp -o drivers/Linux/EthernetServer.cpp
      curl https://raw.githubusercontent.com/marceloaqno/MySensors/linux-fix-stability/drivers/Linux/EthernetClient.cpp -o drivers/Linux/EthernetClient.cpp
      

      from here just run ./configure with your options and then make

      posted in Announcements
      marceloaqno
      marceloaqno
    • RE: 💬 Building a Raspberry Pi Gateway

      @masmat What is the mqtt broker / version you are using?

      posted in Announcements
      marceloaqno
      marceloaqno