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
W

wannabee

@wannabee
About
Posts
14
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • implementing multiple sensors
    W wannabee

    Probably not the easiest to look at since it combined a RGB diode and RFID reader. But it works very well.
    https://github.com/wbcode/ham/blob/master/arduino/MySensorRFIDandRGB/RGBandRFID/RGBandRFID.ino

    I should add that I don't use the Vera as a controler.

    WB

    Development

  • serial reading
    W wannabee

    You perl program needs to tell the arudion Gateway if it Imperial or Metric it should you for it's number. The gateway will forward that information to the node

    Here is post where I explain how it works.
    http://forum.mysensors.org/topic/62/#315

    Basicly the arduion gatweway don't controll high level stuff. It only controlls the low level stuff. the raido communication.

    Your perl program needs to do all the higlevel stuff like responed to request from the network about raido_id, metric system, storing the data,etc. This is what the vera does. you are replacing the vera with your program so now you have to do all the stuff. a quick way forward is to translate https://github.com/mysensors/Vera/blob/master/L_Arduino.lua to perl. You have to build some more function since the Vera is doing stuff like storing data and configuration hat is not in the lua-file.

    This is what I have done in python see https://github.com/wbcode/ham and it transform the mysensor api to/from openhab api.

    /WB

    Troubleshooting

  • serial reading
    W wannabee

    225;255;4;5 is the first message sent from a node at startup if it hasn't a RADIO_ID in it's EEPROM.
    255 is the startup ID
    255 is node or the arduino it self.
    4 is internal message
    5 is I_REQUEST_ID

    The node expect to get a
    255;255:4;5;<RAIDO_ID_THAT_YOU_WANT_TO_ASSIGN_TO_THE_NODE>

    It's an automated way to assign RADIO_ID from the controller. usally a Vera or in your case your perl script needs to do that.

    Or if I rember correctly you can set the RAIDO_ID in the arduion when compiling the code:
    change in the .ino file.
    sensors.begin();
    to
    sensors.begin(<RAIDO_ID_THAT_YOU_WANT_TO_ASSIGN_TO_THE_NODE>);

    To decode the messages sent to and from a node check the tables in http://www.mysensors.org/build/sensor_api#the-serial-protocol

    /WB

    Troubleshooting

  • MySensorGateWay - some type of middleware
    W wannabee

    @hek The openhab integration is stable, It’s some features that are missing, some mapping between openhab itemtypes and mysensor types.

    Controllers

  • MySensorGateWay - some type of middleware
    W wannabee

    I started to to write on a middleware making it possible to communicate with the MySensor network since I don’t own a Vera and didn’t plan to buy one. This project started long before it actually become MySensor. Due to the few hours I have to spare it have taken sometime.

    I currently call the middleware msgw (MySensorGateWay)

    The middleware has evolved from being a solution where I had to write all the graphical presentation of the collected data to actually become a some type of middleware.

    Today it supports

    • bidirectional integration with Openhab
    • unidirectional integration with Domoticz
    • storing values in rrd files. You have to create your own rrd files.
    • assigning Radio IDs

    I spend the time integrating deeper to Openhab since that is what I plan to have as a frontend GUI. I will be fairly easy to add other integrations.

    The middleware is written in python and runs on a Raspberry connected to a Arduino UNO using usb.

    I’m currently running some battery test for my network, not turning out to be what I hoped for. Currently no battery driven sensor sensor have survived a week.

    I implemented RGB control from Openhab to a sensor (I call it a sensor, should maybe call it a node). By sending the RGB hex code as V_IR_SEND command to the sensor.

    I also implemented an RFID tag reader. that reads the ID of the fob and sends it to the gateway. Here I use the type V_IR_RECEIVE

    A combination node using both RFID and RGB can be found at https://github.com/wbcode/ham/blob/master/arduino/MySensorRFIDandRGB/RGBandRFID/RGBandRFID.ino

    For fun or testing purpose I used to fobs to control a relay switch. Depending on which fob were used. Openhub (it’s called a rule in openhab) sent a on or off to the relay through the mygm..

    rule RFID1
    when Item Info_Text_FV_Mancave changed 
    then
    	switch (Info_Text_FV_Mancave.state) {
    		case 'CD59469F' : {say("Card")
    						  sendCommand(Relay1_FV_Mancave,ON)
    						  }
    		case '9DF07DCC' : { say("Keyring")
    						  sendCommand(Relay1_FV_Mancave,OFF)
    						  }
    	}
    end    
    

    My goal is to monitor and automate my house. It will take a long time to get there since I only have a few hour now and then to work on the project. The msgw will only be a middleware that integrates between the sensor network and a GUI.

    All the code I have written can be found on github: https://github.com/wbcode/ham

    Some screenshots from the development of msgw as I call it now.

    veragw_poc3.JPG
    Debug functions and back when I still didn’t plan to integrate it to a GUI frontend.

    veragw_poc2.JPG
    Also old and will be modified to be proxy in through openhab. I want to have “map representing” of the current “now” status of all my sensors. The red over the WC is a motion sensor that have been triggered.

    d_dash.PNG
    Domoticz - dashboard using a domoticz dummy sensor.

    oh_now.PNG
    Openhab - current values received and controls to send commands into the network

    oh_rgb.PNG
    Openhab - RGB controler

    oh_chart.PNG
    RRD graphs generated and presented by Openhab. This one showing a humidity/temp battery driven sensor.

    IMAG0031_2.jpg
    Current lab corner, showing Raspberry, UNO, relay node and my combined RFID and RGB node. (Also some DVDs, who used DVDs today?)

    WB

    Controllers

  • Plugin for Indigo for Mac
    W wannabee

    @marceltrapman said:

    Am I correct that an Arduino board/node always presents itself and its children upon inclusion (after startup) ?
    I do not see a way to set the child id so assume this is set by the Arduino board/node itself?
    Is there a way to 'manually' ask for all available Arduino boards/nodes and/or sensors available through the gateway?

    1 For every sensor on a board you send:
    gw.sendSensorPresentation(<sensor_child_id>,<sensor_type_id>);

    2 the sensor_child_id is set by the board.
    Ie.
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1

    And then later:
    gw.sendSensorPresentation(CHILD_ID_HUM, S_HUM);
    gw.sendSensorPresentation(CHILD_ID_TEMP, S_TEMP);

    In the HumiditySensor.ino

    3 Here @hek have to correct me. The answer is maybe, if you dig deep in the routing table in the gateway. But the gateway will lose that info when rebooted. It would also be possible to send a broadcast to all nodes asking them for info, but in that case you have to implement a function in the nodes that answers on broadcast. It will also make them not sleep. I keep track of available sensors in the python code. It’s the same way the vera is doing it. You basicly stores all sensors that have sent a presentation.

    Indigo Domotics

  • Plugin for Indigo for Mac
    W wannabee

    @marceltrapman and you clear the eeprom by uploading https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/examples/ClearEepromConfig/ClearEepromConfig.ino.

    Indigo Domotics

  • Plugin for Indigo for Mac
    W wannabee

    @marceltrapman Glad it was helpful, Tricky part is to develop something that sends information into the network from outside. ie when you want to turn a switch on or off.

    Indigo Domotics

  • Plugin for Indigo for Mac
    W wannabee

    10;255;4;13; is the interesting part. The messages above is network debug message.
    10 - is the Raido ID
    255 - is the Node, see it as the arduino without the sensors.
    4 - means internal message type. It’s used to send messages between an intelligent controller and the network. i.e vera or what you are about to write.
    13 - is the subtype of the internal message in this case I_UNIT.

    So what your arduino is doing is requesting the unit type for your sensor network. It’s ethier M as in Metric or I as in imperial.

    The arduino except to get a answer back telling it either
    10;255;4;13;M or 10;255;4;13;I

    This is the call in the arduino requesting what metric system to use.
    metric = gw.isMetricSystem();

    All types are explained at http://www.mysensors.org/build/sensor_api

    What you want to do is port most of the functions in https://github.com/mysensors/Vera/blob/master/L_Arduino.lua
    and build some yourself since the Vera is doing some part that you don’t know about. Keeping track of some information.

    You can see my python project (still without a name) at https://github.com/wbcode/ham where you can steel, borow, push or fork ideas/code to/from.

    WB

    Indigo Domotics

  • Why not the Uno as a Serial Gateway
    W wannabee

    The Uno works fine as a serial gateway. I have one running for 5+ month connected to a Raspberry Pi, using stock mysensor code.

    WB

    .

    General Discussion

  • Code for beta-testing?
    W wannabee

    @andriej and @jendrush, I commited some code to my repository for the python gateway with half (oneway) Domoticz integration. It also support Openhab, The Openhab integarion is what I think I will integarate for my self and continue to develop. Domoticz needs provide a proper API that I can use without spending a lot of time trying to figure out how it works. My code is at https://github.com/wbcode/ham. You can try it out if you want. The installation part and configuration is missing a lot of instructions.

    Will create my own thread for my gateway code when I have a name for it and I have spent the time to do a proper update to the wiki and better a presenation on what you cand do.

    Please note that iit's not a full replacment for a Vera and it's my first time codeing python...

    Controllers

  • Code for beta-testing?
    W wannabee

    @andriej Yes, tested that, Even if the python gw handles to assign RAIDO_ID. Also cleared the EEPROM to be sure it didn't conflict between the versions. The interesting part is that it doens't even write to the serial line. Time to sleep and see if I cand find a few hours on Wednesday to get it working again.

    Controllers

  • Welcome
    W wannabee

    Impressive work @hek!
    Just ordered som more stuff from Asia and started to code again.

    Announcements

  • Code for beta-testing?
    W wannabee

    @andriej (I guess it the same andriej) suggested that to me, on my github account, after finding my first version of my python gw running on Raspberry with a Andruion connected.I did some quick hack yesterday and manged to get my python gw to send the info from a DHT11->Arduino (nano)->RF24->RF24->Arduino (Uno)->Raspberry to Domoticz using a dummy devices in Domoticz and the json API. Could say that I'm not thrilled by the Domoticz API implemantion or API documentation. For some reason the dummy humdity device doesn't create grapth even if it gets the data.

    d_dash.PNG d_hum.PNG d_temp.PNG

    Anyway so it can be done. Now over to the boring part, This was done on an earlier version (2014-01-17) of the MySensor system. Today when I tried mearge the code to work with the latest version, my DHT connected arduino doesn't send anything. and I can't get it to write to the serial port to figure out what's wrong. Hopfully I will be able to find some time to resolve this during the week/weekend and publish something that could be worked on.

    WB

    Controllers
  • Login

  • Don't have an account? Register

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