MyController.org


  • Plugin Developer

    MyController.org - The Open Source Controller for MySensors.org
    I would like to introduce MyController.org to the Open Source World 🙂
    Still incomplete documents. I'm working on it. We will have complete documents soon.
    Document ready: Document Page

    Source: https://github.com/mycontroller-org/mycontroller
    Demo Link: http://demo.mycontroller.org (Authentication: admin/admin)

    To know about new releases visit/watch: http://forum.mysensors.org/topic/2058/releases


  • Admin

    @jkandasa wow! nice work


  • Admin

    @jkandasa

    You've been busy. Great job!



  • @jkandasa

    We want pictures!!!!


  • Hero Member

    Great work...but yes pls some pics!!! ( as they tell 1000 words! )


  • Plugin Developer

    Screenshots of MyController.org server.

    pic.png
    pic1.png
    pic2.png
    pic3.png
    pic4.png
    pic5.png
    pic6.png
    pic7.png
    pic8.png
    pic9.png
    pic10.png
    pic11.png


  • Admin

    @jkandasa

    Looks great,

    Let me know when you want to add it to the main site controller list. Just send me an email.


  • Plugin Developer

    @hek Thank you! I will create some level of documents then we will add it in main site.


  • Plugin Developer

    Demo Link: http://demo.mycontroller.org

    Authentication: admin/admin



  • Sweet!
    Maybe exactly what I was looking for at the '?' mark in my post.
    Does your controller also include a MQTT server to connect / export events to another home automation system? (like for instance OpenHAB?)
    Kurt


  • Plugin Developer

    @Kurt Yes, it will fill your '?' mark with serial gateway. Right now MyController.org supports only serial gateway.

    It will log all the events, you can schedule a timer, alarm and you can upload firmware of your nodes, many other features.

    I never own Edison, But I guess you can run MyController.org server in Edison, if it supports Java 1.8, ~30 MB disk space and 40 MB RAM.


  • Hardware Contributor

    Great work - That looks fantastic! I'm curious what you envision as the longer term goals for the project? Do you see there being custom programming features (plugins via java, python, etc)? Feature wise, how does it compare with existing automation systems like openhab?


  • Plugin Developer

    @TD22057 Thank you! As you know already MySensors.org is a fantastic project for Open Source world. I would like to thank you MySensors.org the way of giving my contribution back to MyController.org, hence MyController.org born.

    Longer term vision: Align with MySensors.org (primary Open Source Controller)
    Features: https://github.com/mycontroller-org/mycontroller#available-features

    There is no plugin concept available. But it has excellent REST API, You can use your own client.



  • will you be supporting eithernet gateways in the near future or are you only going to support serial gw's?


  • Plugin Developer

    Definitely I will support for Ethernet gateway. I'm learning Ethernet gateway.


  • Hero Member

    I like how it does graphical reports on all the sensors, straight up on Day 1! Nice!



  • Just gave it a quick test ... Nice! Worked +/- straight our of the box on my Mac. Next up is indeed to test on my Edison as it's very low power which is nice for 24/7 use.

    Are you planning MQTT support?
    I like your intend to align with MySensors which I interpret as 'focus on supporting MySensor functionality perfectly' rather than trying to also become a controller for other (home automation - zwave, x10, ... ) protocols as well? If your controller focusses on MySensor it could perfectly sync up with another automation controller using something like MQTT (or perhaps REST like you say is already supported)

    Kurt


  • Hardware Contributor

    +1 vote for MQTT. I need a controller that can send out events via MQTT messages as they occur so other software can respond to them. REST is great for some things but I don't want to poll the controller to check it's state.


  • Contest Winner

    Interesting stuff! Good work @jkandasa !


  • Plugin Developer

    @kurt Thank you! Kindly post us status of Edison test.

    Right now I do not have any road map to support for other home automatons (like zwave,x10,etc.,). I guess we can do everything with MySensors.org.

    @Kurt, @TD22057 I will think about MQTT support for events.. Can you please open new enhancement under https://github.com/mycontroller-org/mycontroller/issues We can discuss further about this feature.


  • Hero Member

    then websockets would be best !

    @TD22057 said:

    +1 vote for MQTT. I need a controller that can send out events via MQTT messages as they occur so other software can respond to them. REST is great for some things but I don't want to poll the controller to check it's state.


  • Hardware Contributor

    @epierre said:

    then websockets would be best !

    I'm afraid I have to disagree. MQTT gives you decoupling which is huge advantage. You can write lots of simple systems that broadcast information without worrying about where it's going or what's being done with it. And those systems can start up and shut down as they need to or as you try out new things. It allows you to add to and modify your system without touching most of the components. The more I think about it, the more strongly I feel that the best MySensors system is really a gateway/mini-controller that convert the radio messages into MQTT messages and that's it. Then you can have as many "big" controllers as you want to get web interfaces (MyController), programming ability (OpenHab), that can all listen and publish messages. I'm not sure I'm really describing how powerful this is but once you have a system set up this way, it's absolutely fantastic.

    I have a bunch of small scripts that read hardware data in my house. Each is custom for it's application which include reading the electric meter, solar panel output, wireless weather station, etc. They each just publish MQTT messages. I wrote them once and have never really touched them since. But I keep playing around with consumers of those messages. I'm experimenting with different databases for persistence, web GUI's for plotting, alerts sent to my phone, etc. Using MQTT means I never need to touch the hardware specific bits when I want to try out something new.

    A MySensors gateway is basically the same kind of system to me - define a message format, convert radio messages and publish them, subscribe to "commands" and convert them back to radio messages. Once you have that, you can run as many different "controllers" as you want since each is just sending and receiving messages. Granted all of this is possible now but there are multiple MQTT gateways (one is a client, one is a pseudo-broker), a few scripts that use the serial connection to do the same thing, and they aren't part of the official release. They also can publish numerical messages or put sensor text into them so there isn't an official message API.

    Let's say I have a controller that's working well for me. Along comes MyController (which looks fantastic) and I want to try it out. If it used MQTT, I could just start it up and see how it works with my systems and if I want to use it. Controllers that require the serial gateway basically are all or nothing - either they get the serial line or nothing. So I have to install that controller somewhere near my gateway (not always practical), shut down my existing system, try them out, and then make a choice if I want to keep it or not. If all the controllers used MQTT, then I can run as many as I like and use the best parts of each one. Or, each one can be a much smaller collection of loosely coupled parts that each do a single thing really well (plotting, logging, scripting, etc).

    Getting off the soap box now... Feel free to ignore my early morning, haven't had my coffee yet, pseudo-ranting... 😄



  • Also, running a controller in a virtual environment makes it difficult to connect to a serial gateway 😉


  • Plugin Developer

    Created new feature request to support MQTT gateway - https://github.com/mycontroller-org/mycontroller/issues/3


  • Hero Member

    @TD22057 said:

    @epierre said:

    then websockets would be best !

    I'm afraid I have to disagree. MQTT gives you decoupling which is huge advantage. You can write lots of simple systems that broadcast information without worrying about where it's going or what's being done with it. And those systems can start up and shut down as they need to or as you try out new things. It allows you to add to and modify your system without touching most of the components. The more I think about it, the more strongly I feel that the best MySensors system is really a gateway/mini-controller that convert the radio messages into MQTT messages and that's it. Then you can have as many "big" controllers as you want to get web interfaces (MyController), programming ability (OpenHab), that can all listen and publish messages. I'm not sure I'm really describing how powerful this is but once you have a system set up this way, it's absolutely fantastic.

    Well I disagree also on this for you would send all around your home network informations on devices and any device plugged on it youdon't have enough control on or which is hijacked will gain control of all you home automation... so if using MQTT do it with a PKI or something similar, this has an overhead but it will preserve your future

    Getting off the soap box now... Feel free to ignore my early morning, haven't had my coffee yet, pseudo-ranting... 😄

    same for me 😄


  • Plugin Developer

    Released: 0.0.2-alpha2 with addition of Ethernet-Gateway and MQTT-Gateway support.

    Visit https://github.com/mycontroller-org/mycontroller for installation instructions.



  • Looks very cool and straight forward. Nice work!

    Wondering if there is a way to extract the logged sensor data for import into other packages/spreadsheets etc for further analysis?


  • Plugin Developer

    @diggs Right now there is no way to extract to spread sheet other than extracting from database directly. Kindly propose your requirements in https://github.com/mycontroller-org/mycontroller/issues



  • @jkandasa thanks for the reply. Will add in the issues section

    Cheers


  • Plugin Developer

    Anyone tried MyController.org to setup locally? If yes kindly share your experiences 😉


  • Plugin Developer



  • @jkandasa very nice work! As for my experience, I had a bit of trouble getting it started. Somehow, I was under the impression that double-clicking start.bat would automatically start the Java app. It was later that I realized I then need to point my browser to localhost:8443 and log in. Your WIKI is well written, but I somehow missed that step. BTW, I'm using the Ethernet gateway and editing settings was a breeze.

    Possible bug to report- Sensors with an ID of 0 (zero) are not auto-detected. I have four nodes with sensor ID's of 0 that I know are sending data but they do not show up on Sensors page or on Action Board.


  • Plugin Developer

    @d-smes thank you to gave a try with MyController.org. Could you please see your log file is there any error? logs/mycontroller.log


  • Plugin Developer

    @d-smes can you see other sensors in MyController page? other than sensor id 0



  • @jkandasa Yep, error log full of the same sets of errors. Example of one error pair:

    2015-09-16 11:41:55,150 WARN [Thread-3] [org.mycontroller.standalone.db.dao.SensorDaoImpl:52] Sensor:[org.mycontroller.standalone.db.tables.Sensor@e7f65f[id=<null>,sensorId=0,type=<null>,messageType=38,name=<null>,updateTime=<null>,status=<null>,lastValue=<null>,unit=<null>,node=org.mycontroller.standalone.db.tables.Node@18dbb32[id=4,name=<null>,version=<null>,updateTime=<null>,type=<null>,mySensorsVersion=<null>,batteryLevel=<null>,eraseEEPROM=<null>,firmware=<null>]]], Sensser Id should be in the range of 1~254
    2015-09-16 11:41:55,150 ERROR [Thread-3] [org.mycontroller.standalone.mysensors.MessageMonitorThread:68] RawMessage[NodeId:4,ChildSensorId:0,MessageType:1,Ack:0,SubType:38,PayLoad:4.825] throws exception while processing!, 
    java.lang.NullPointerException: null
    	at org.mycontroller.standalone.mysensors.ProcessRawMessage.recordData(ProcessRawMessage.java:480) ~[mycontroller-standalone-0.0.2-alpha2-single.jar:na]
    	at org.mycontroller.standalone.mysensors.ProcessRawMessage.setSubMessageTypeSelector(ProcessRawMessage.java:449) ~[mycontroller-standalone-0.0.2-alpha2-single.jar:na]
    	at org.mycontroller.standalone.mysensors.ProcessRawMessage.messageTypeSelector(ProcessRawMessage.java:91) ~[mycontroller-standalone-0.0.2-alpha2-single.jar:na]
    	at org.mycontroller.standalone.mysensors.MessageMonitorThread.processRawMessage(MessageMonitorThread.java:60) [mycontroller-standalone-0.0.2-alpha2-single.jar:na]
    	at org.mycontroller.standalone.mysensors.MessageMonitorThread.run(MessageMonitorThread.java:82) [mycontroller-standalone-0.0.2-alpha2-single.jar:na]
    	at java.lang.Thread.run(Unknown Source) [na:1.8.0_60]
    

    The clue appears to be "Sensser Id should be in the range of 1~254"

    Nodes with multiple sensors show e.g. sensors 1- 11 but not sensor 0.


  • Plugin Developer

    @d-smes My bad it was a mistake, I understand wrongly like, we will not have sensor id 0, should have only from 1~254, now corrected and will allowed 0~254 id,

    you have to stop your mycontroller server and replace lib/mycontroller-standalone-0.0.2-alpha2-single.jar with the fix http://www.filedropper.com/mycontroller-standalone-002-alpha2-single


  • Plugin Developer

    MyController.org Released 0.0.2-alpha3 👍
    For user documents visit MyController.org



  • Just wondering if it is possible to run two controllers side by side both looking at the same serial port?

    i.e. can I run Domoticz and MyController at the same time in serial mode with the one gateway or would it cause issues?


  • Plugin Developer

    @diggs for my knowledge we could not share same port directly for two applications. We may need to use some adapters for this operation. I do not know how much it is possible.



  • @diggs I was looking into doing the same thing. There are ways to duplicate a serial port using utilities like socat that should work. I was having issues with one side of the redirect disconnecting when there was no data to read. I was thinking of just writing up a quick python utility that would have the features I wanted. ser2net would work well, but it only redirects the port to the network, it doesn't do local redirection.



  • @jkandasa Would it be possible to add a graph for the battery percentage?


  • Plugin Developer

    @ericvdb Thank you for your interest with MyController.org. I have created a request for battery percentage. Kindly update your thoughts on this https://github.com/mycontroller-org/mycontroller/issues/14

    How often node sends battery percentage?



  • @jkandasa said:

    How often node sends battery percentage?

    That depends on your sketch. I update battery every hour, but only if there are changes.



  • Thank you - This is what I have been looking for. I was getting ready to write my own which I did not have time for. It is simple displays the data that is needed and easy to debug. The other controllers I tried I spent more time debugging because of the bloat. I can not focus on my sensor development.



  • Nice ! Very clean GUI !

    I installed this controller on RPI with serial gateway and it works like a charm with two TEMP sensors.

    It will be good if you can use the RPI GPIO to connect directly to NRF24 RF module instead on adding the serial gateway ( see http://iot-playground.com ..)

    I wish you good luck with this project.


  • Hardware Contributor

    Actually, you can add the NRF24 directly to the Raspberry and use it as a gateway at the same time:

    http://forum.mysensors.org/topic/1151/tutorial-raspberry-pi-nrf24l01-direct-connection


  • Plugin Developer

    @davidbd said:

    It will be good if you can use the RPI GPIO to connect directly to NRF24 RF module instead on adding the serial gateway ( see http://iot-playground.com ..)

    Yes, I have plan to implement NRF24l01 directly. I have to learn more about how mysensors gateway is working. Also planing to implement RPI GPIO port access from MyController.org directly

    I wish you good luck with this project.

    Thank you! @davidbd


  • Plugin Developer

    @GertSanders said:

    Actually, you can add the NRF24 directly to the Raspberry and use it as a gateway at the same time:

    http://forum.mysensors.org/topic/1151/tutorial-raspberry-pi-nrf24l01-direct-connection

    Thank you @GertSanders let me have a look. As MyController.org is designed with pure Java language I have to implement with some wrapper or with the help of pi4j module


  • Hardware Contributor

    @jkandasa
    I used the Raspberry version of Mysensors gateway for software to set up a serial gateway. Then Inadded a symlink link with shorter name so domoticz could see it. If your software can detect the normal ttyMySensorGateway then no need for a symlink.
    Hardware toconnect radio and raspberry is simple interconnect with GPIO. Same connections as with wire. I made a little board for it. Link to that is also somewhere on the forum.


  • Plugin Developer

    @GertSanders said:

    @jkandasa
    I used the Raspberry version of Mysensors gateway for software to set up a serial gateway. Then Inadded a symlink link with shorter name so domoticz could see it. If your software can detect the normal ttyMySensorGateway then no need for a symlink.
    Hardware toconnect radio and raspberry is simple interconnect with GPIO. Same connections as with wire. I made a little board for it. Link to that is also somewhere on the forum.

    @GertSanders This is nice, I guess no need to change anything in MyController software. Let me check this and update you. Thank you.


  • Plugin Developer

    @GertSanders @davidbd Just now I tested https://github.com/mysensors/Raspberry with MyController.org server it is working perfectly. Thank you very much! you guys saved hardware cost and added direct NRF24 support to MyController.org 😃

    I did all the steps as root user (running MyController.org server also as a root user). Kindly let me know if you face any issues.

    Install https://github.com/mysensors/Raspberry and connect NRF24L01+ as mentioned on the page.

    Now we have to point-out ttyMySensorsGateway port to MyController.org server via it is configuration file

    Stop your MyController server change a line,
    File Name: mycontroller/conf/mycontroller.properties

    mcc.serialport.name=/dev/ttyMySensorsGateway
    

    Start your MyController server. That is it 🙂


  • Hardware Contributor


  • Hardware Contributor


  • Plugin Developer



  • @jkandasa Well Done ! Thanks ! you are doing great Job here.



  • @jkandasa

    Hi,

    I just install the PiGatewaySerial in RPI and run as a daemon but found CPU is almost 100% !

    2173 root 20 0 3740 1624 1416 R 98.8 0.4 2:17.91 PiGatewaySerial


  • Plugin Developer

    @davidbd said:

    @jkandasa

    Hi,

    I just install the PiGatewaySerial in RPI and run as a daemon but found CPU is almost 100% !

    2173 root 20 0 3740 1624 1416 R 98.8 0.4 2:17.91 PiGatewaySerial

    @davidbd I donot face any issue like you said.

    root@raspbx:~# ps -p 11415 -o %cpu,%mem,cmd
    %CPU %MEM CMD
     0.0  0.0 /usr/local/sbin/PiGatewaySerial -d
    

    I do not have much knowledge on PiGatewaySerial we have a discussion about this topic on http://forum.mysensors.org/topic/1151/tutorial-raspberry-pi-nrf24l01-direct-connection/39

    Some people already reported 100% cpu usage. Can you please check and post your query there?

    My RPI setup.

    root@raspbx:~# uname -a
    Linux raspbx 3.18.6-v7+ #753 SMP PREEMPT Sun Feb 8 14:53:56 GMT 2015 armv7l GNU/Linux
    root@raspbx:~# cat /etc/issue
    Raspbian GNU/Linux 8 \n \l
    
    root@raspbx:~# cat /etc/debian_version
    8.0
    

    RPI Model: Raspberry pi 2 Model B

    I ran everything as a root user.



  • The 100% cpu usage happens only if nothing connects to /dev/ttyMySensorsGateway, at least thats what i experienced.


  • Hardware Contributor

    My CPU load hardly ever goes over 1%, and that is including a running Domoticz controller in parallel with the serial gateway.

    Gert



  • @jkandasa As reported by users ... the 100% cpu usage happens only if nothing connects to /dev/ttyMySensorsGateway
    I am OK now but maybe worth to check why as this is not good behaviour.


  • Admin

    Just finished setting up MyController, so it runs besides domoticz, and NodeRed. Looks fine so far, but haven't had that much time to delve into MyController specifics yet.

    Have set it up so that when ever I turn a light on / off in MyController, Domoticz also sees this (and of course the sensor network).

    Plan was to try and use MyController for OTA firmware updates, and keep track of firmware versions in my network.



  • For some reason cannot seem to get it running.

    Have installed the software and the server appears to start, but there is no web access and this is what I get when I check the log.

    Have I setup something incorrect

    Running on a PI

    Exception in thread "main" java.lang.UnsupportedClassVersionError: org/mycontroller/standalone/StartApp : Unsupported major.minor version 52.0
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
            at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
    

    java version "1.7.0_40"
    Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
    Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode)


  • Plugin Developer

    @diggs said:

    For some reason cannot seem to get it running.

    java version "1.7.0_40"
    Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
    Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode)

    You should update your java version to 1.8 or later. For raspberry PI oracle java is recommended for MyController.

    http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

    jdk-8u60-linux-arm32-vfp-hflt.tar.gz

    @diggs hope this link will help you to update your java: http://www.rpiblog.com/2014/03/installing-oracle-jdk-8-on-raspberry-pi.html


  • Plugin Developer

    @tbowmo said:

    Just finished setting up MyController, so it runs besides domoticz, and NodeRed. Looks fine so far, but haven't had that much time to delve into MyController specifics yet.

    Have set it up so that when ever I turn a light on / off in MyController, Domoticz also sees this (and of course the sensor network).

    Plan was to try and use MyController for OTA firmware updates, and keep track of firmware versions in my network.

    @tbowmo Nice! you can give try for other features also which is available in MyController 😉
    Alarm, Timer, Forward Payload, UID, etc.,



  • @jkandasa Thanks for that.

    The latest Java version has go me going as far as server access goes, but I am having issues opening the serial port it seems.

    I am trying to run in parallel with Domoticz, but I maybe having an issue trying to access the same port I am guess.

    Suggestions on how to get around that?

    2015-09-27 15:45:16,568 ERROR [main] [org.mycontroller.standalone.gateway.serialport.SerialPortPi4jImpl:68] Failed to load serial port,
    java.io.IOException: Unable to open the serial port/device. (Error #2)
            at com.pi4j.jni.Serial.open(Native Method) ~[mycontroller-standalone-0.0.2-alpha4-single.jar:na]
            at com.pi4j.io.serial.impl.SerialImpl.open(SerialImpl.java:151) ~[mycontroller-standalone-0.0.2-alpha4-single.jar:na]
            at com.pi4j.io.serial.impl.SerialImpl.open(SerialImpl.java:242) ~[mycontroller-standalone-0.0.2-alpha4-single.jar:na]
            at org.mycontroller.standalone.gateway.serialport.SerialPortPi4jImpl.initialize(SerialPortPi4jImpl.java:61) [mycontroller-standalone-0.0.2-alpha4-single.jar:na]
            at org.mycontroller.standalone.gateway.serialport.SerialPortPi4jImpl.<init>(SerialPortPi4jImpl.java:40) [mycontroller-standalone-0.0.2-alpha4-single.jar:na]
            at org.mycontroller.standalone.StartApp.startServices(StartApp.java:217) [mycontroller-standalone-0.0.2-alpha4-single.jar:na]
            at org.mycontroller.standalone.StartApp.main(StartApp.java:78) [mycontroller-standalone-0.0.2-alpha4-single.jar:na]
    2015-09-27 15:45:16,646 INFO [main] [org.mycontroller.standalone.db.TimerUtils:144] Updated Time:[SunRise:Sun Sep 27 10:36:00 AEST 2015, SunSet:Sun Sep 27 22:41:00 AEST 2015], City:[latitude:11.2333, longit$
    [Sun Sep 27 15:45:21 AEST 2015] TJWS httpd 0.0.0.0 - [SSL: ServerSocket[addr=0.0.0.0/0.0.0.0,localport=8443]] is listening.
    

  • Plugin Developer

    @diggs said:

    @jkandasa Thanks for that.

    The latest Java version has go me going as far as server access goes, but I am having issues opening the serial port it seems.

    I am trying to run in parallel with Domoticz, but I maybe having an issue trying to access the same port I am guess.

    Suggestions on how to get around that?

    I guess you cannot share same port for two different applications. We may go with some third party tools to share serial port across applications. But, I do not have any experience on it.

    In this case to run MyController server, stop MyController server and Domoticz controller, then start MyController server, it will work.



  • @jkandasa Thanks

    Have now done all that. Stopped the Domoticz server, started Mycontroller. I get the webpage up now, but still no nodes showing up and for some reason nothing is being written to my logs the past few hours at all.

    What can I look at?



  • @diggs

    • stop the server
    • connect to your serial port and see if you get any response from gateway ( minicom/miniterm etc ... )
    • If above work , check your config for correct serial ports settings.
    • If above doesnt work not check your serial gateway


  • @davidbd Thanks for the reply.

    Yep, can connect to the port and see the node / gateway data in the line.

    Still nothing though in the Mycontroller

    All my settings seem pretty standard, so not sure what the issue would be or what to check next.

    #========================================================================
    # MySensors Gateway settings
    # Select Type of gateway will be used, Only one gateway will be used
    # Types -> serial, ethernet, mqtt
    #========================================================================
    mcc.ethernet.gateway.type=serial
    
    #========================================================================
    # MySensors Serial port settings
    # In this section select: Driver, port name and baud rate
    # Available drivers -> [pi4j, jssc, jserialcomm, auto]
    #========================================================================
    mcc.serialport.driver.type=auto
    mcc.serialport.name=/dev/ttyACM0
    mcc.serialport.baud.rate=115200
    
    #========================================================================
    # MySensors Ethernet Gateway settings
    # Update host name/ip and port number, Default: 192.168.178.6:5003
    # Keep alive check frequency in seconds
    #========================================================================
    mcc.ethernet.gateway.host=192.168.178.6
    mcc.ethernet.gateway.port=5003
    mcc.ethernet.gateway.keep.alive.frequency=60
    
    #========================================================================
    # MySensors MQTT Gateway settings
    # Update broker host name/ip and port number, Default: 192.168.178.6:1883
    # Root topic name of broker
    # Note: MQTT_TRANSLATE_TYPES will be not supported
    # Disable MQTT_TRANSLATE_TYPES in your MQTT gateway
    #========================================================================
    mcc.mqtt.gateway.broker.host=192.168.178.6
    mcc.mqtt.gateway.broker.port=1883
    mcc.mqtt.gateway.broker.root.topic=MyMQTT
    
    #========================================================================
    # Database
    # Where do you want to keep your database.
    # It is highly recommended  to take a backup of this db on upgrade. 
    # Database: H2DB, location and name, example:/tmp/mycontroller
    #========================================================================
    mcc.h2db.location=../conf/mycontroller
    
    #========================================================================
    # Web files, will be located under ../www by default
    # For web used angularjs
    #========================================================================
    www.file.location=../www/
    
    #========================================================================
    # Web Application server configuration
    # bind.address - interface to bind. 0.0.0.0 - all available interfaces
    # You can use either http or https, enable.https - https is enabled
    # if https is enabled specify keystore file details
    # It is highly recommended to use https also change default keystore file
    #========================================================================
    bind.address=0.0.0.0
    enable.https=true
    http.port=8443
    ssl.keystore.file=../conf/keystore.jks
    ssl.keystore.password=password
    ssl.keystore.type=JKS
    
    #logger configuration - logback.xml
    


  • @diggs Have no idea but you can try to change your serial port driver


  • Plugin Developer

    @diggs said:

    @davidbd Thanks for the reply.

    Yep, can connect to the port and see the node / gateway data in the line.

    Still nothing though in the Mycontroller

    All my settings seem pretty standard, so not sure what the issue would be or what to check next.

    @diggs just now I tested with RPI native port(/dev/ttyACM0 /dev/ttyAMA0) and gives some issue, let me find out the root cause,



  • @jkandasa OK thanks

    At least I am not going crazy 🙂


  • Plugin Developer

    @jkandasa said:

    @diggs just now I tested with RPI native port(/dev/ttyACM0) and gives some issue, let me find out the root cause,

    @diggs Just now I confirmed that issue is not with MyController server. I didn't disable default kernel console access of serial port. Hence I couldn't not access inbuilt RPI serial port from MyController server.
    I followed this page to gain user access for RPI default serial port.

    Now I can access default RPI serial port without any trouble. Hope you are also facing same issue.



  • @jkandasa Checked my settings and they were already set as per that article, so I don't believe that is the trouble I am facing. From the logs I sent you, anything else you think could be causing the issue. Was the port being opened OK in the system?


  • Plugin Developer

    @diggs said:

    @jkandasa Checked my settings and they were already set as per that article, so I don't believe that is the trouble I am facing. From the logs I sent you, anything else you think could be causing the issue. Was the port being opened OK in the system?

    @diggs Can you check on your RPI do you have /dev/ttyAMA0?

    pi@raspberrypi ~ $ ls -lh /dev/ttyA*
    crw-rw---T 1 root dialout 204, 64 Jan  1  1970 /dev/ttyAMA0
    

    If you have /dev/ttyAMA0 try MyController server with /dev/ttyAMA0. I hope it should work. Kindly post your RPI hardware and software details.



  • @jkandasa I do have an AMA0, but it does not work on that one either. The gateway is definitely connected to ACM0. Which is the one it works on when I have Domoticz connected up.

    Something odd is happening with the PI USB side of things. Tried switching to another port but no luck there either.

    As a side, I installed on windows and it works fine, so I know the gateway is OK, but I really want it running on the PI at some point


  • Plugin Developer

    @diggs said:

    @jkandasa I do have an AMA0, but it does not work on that one either. The gateway is definitely connected to ACM0. Which is the one it works on when I have Domoticz connected up.

    Something odd is happening with the PI USB side of things. Tried switching to another port but no luck there either.

    Are you using USB to ttl connector or native RPI tx/rx pin? can you post your RPI hardware and software details?

    As a side, I installed on windows and it works fine, so I know the gateway is OK, but I really want it running on the PI at some point



  • @jkandasa as discussed on chat, but thought I would put the info her as well.

    Using one of the 4 USB ports on the PI.

    Versions

    Linux raspberrypi 4.1.6-v7+ #810 SMP PREEMPT Tue Aug 18 15:32:12 BST 2015 armv7l GNU/Linux



  • This is fantastic. Thank you!

    I am very grateful but I do have a feature request. I am collecting data in a greenhouse (and in the gardens) with mysensors. The more automation, the better. However, there are some instruments we still use manually, record data in a notebook, maybe copy to excel and manually create charts. It is very tedious and isolated form the automated sensor data.

    It seems with your controller I can add a custom sensor (or use any of the other sensors) and with the Action board send data to the sensor. The feature I want is to enter data and have it appear as if the sensor sent the data. This data would then be logged along with all the automated data.

    For example, we manually measure Nitrites. If I could add a custom sensor (a Manual Entry Sensor) and the action board allowed receiving data from the sensor it would provide a huge benefit. (No send data for this type of sensor is needed, only receive).

    I am not sure how much work would be needed but it could also be used to test rules and other configurations.

    Thanks for your work.


  • Hardware Contributor

    @bpair said:

    This is fantastic. Thank you!

    I am very grateful but I do have a feature request. I am collecting data in a greenhouse (and in the gardens) with mysensors. The more automation, the better. However, there are some instruments we still use manually, record data in a notebook, maybe copy to excel and manually create charts. It is very tedious and isolated form the automated sensor data.

    It seems with your controller I can add a custom sensor (or use any of the other sensors) and with the Action board send data to the sensor. The feature I want is to enter data and have it appear as if the sensor sent the data. This data would then be logged along with all the automated data.

    For example, we manually measure Nitrites. If I could add a custom sensor (a Manual Entry Sensor) and the action board allowed receiving data from the sensor it would provide a huge benefit. (No send data for this type of sensor is needed, only receive).

    I am not sure how much work would be needed but it could also be used to test rules and other configurations.

    Thanks for your work.

    IMO, That's one of the good reasons to use MQTT as the communication system. MySensors gets translated to MQTT messages by the gateway and that's all the controller sees. Then adding more "readings" from manual sources or any other source is just a matter of sending a message into the system from that source. There are any number of GUI and command line tools (mosquitto_pub) you can use to post a message that would make entering manual readings very easy.



  • @TD22057 I do like MQTT but I wish the topic format was more standardized for sensor networks. I could certainly even see using something like dweet.io for publishing these messages to the world (beyond the mqtt broker).

    However in this case I plan to have different students and classes adding sensors, manually taking measurements, etc.. If the MyController Action board was an easy 1 stop place for this, making it easy to add new "manual sensors" without the problems of how to format the topic or how to post an mqtt message from the command line it would be great.

    I have thought about formalizing this manual entry with Node-Red but MyController is better than what I could create.


  • Plugin Developer

    @bpair Thank you to give a try with MyController! I understand that you want to create a chart(automatically by MyController) for your custom data and you want to disable send payload option for some sensors.

    Can you give some example how your data will be looking? Is it pure numeric data? And what is the custom variable have you used?

    To disable send payload we have ticket, I'm working on it https://github.com/mycontroller-org/mycontroller/issues/5


  • Plugin Developer

    @TD22057 said:

    IMO, That's one of the good reasons to use MQTT as the communication system. MySensors gets translated to MQTT messages by the gateway and that's all the controller sees. Then adding more "readings" from manual sources or any other source is just a matter of sending a message into the system from that source. There are any number of GUI and command line tools (mosquitto_pub) you can use to post a message that would make entering manual readings very easy.

    @TD22057 The current MQTT gateway supports only limited features and a big drawback is we cannot use it directly on internet as it does not have any security option and limited to number of connections

    For this reason I'm implementing MQTT broker support in MyController server. Here we can connect our mysensors gateway (serial/Ethernet) to MyController. Connect all our MQTT client to MyController with authentication

    https://github.com/mycontroller-org/mycontroller/issues/7



  • @jkandasa Wow, quick replies.

    Actually the charts are not that critical but it would be very simple charts showing the value with a custom unit (for example mg/L) over time. The unit should be specified when adding the sensor to MyController.

    There will never be a physical sensor connected to MyController for these custom sensors. These are virtual sensors. Because there is no physical sensor connected to MyController a person would be manually entering the data (the person is the sensor).

    An example may help:

    We have a fish tank with sensors for measuring water temperature, pH, and water level. The data from these sensors is easily sent to a controller as well as to thingspeak or a local database.

    Data for ammonia, nitrates and nitrites is also recorded but we have no sensor recording this data. A person manually records these measurements in a notebook.

    I do not want the person to record this data in a notebook. I want this person to record the data in MyController. Then all of the data from the sensors and all of the data manually entered would be in the same place.

    So I would add a custom sensor to MyController with a name of "Tank A Nitrates" and a unit of "mg/L". The Action Board shows the new sensor and lets me enter a sensor reading - 1.5 mg/L.

    Does that make sense?


  • Plugin Developer

    @bpair said:

    @jkandasa Wow, quick replies.

    Actually the charts are not that critical but it would be very simple charts showing the value with a custom unit (for example mg/L) over time. The unit should be specified when adding the sensor to MyController.

    @bpair For now if you use the variable which is returning (somewhat matches for you V_LEVEL)

    return PAYLOAD_TYPE.PL_DOUBLE;
    

    you will get graphical report. Check in the code

    And you can add your own custom unit. Under Action Board on your custom sensor click on the image edit and update your unit.
    add-unit.png

    In document you can see under the section 4.10 Edit

    There will never be a physical sensor connected to MyController for these custom sensors. These are virtual sensors. Because there is no physical sensor connected to MyController a person would be manually entering the data (the person is the sensor).

    An example may help:

    We have a fish tank with sensors for measuring water temperature, pH, and water level. The data from these sensors is easily sent to a controller as well as to thingspeak or a local database.

    Data for ammonia, nitrates and nitrites is also recorded but we have no sensor recording this data. A person manually records these measurements in a notebook.

    I do not want the person to record this data in a notebook. I want this person to record the data in MyController. Then all of the data from the sensors and all of the data manually entered would be in the same place.

    So I would add a custom sensor to MyController with a name of "Tank A Nitrates" and a unit of "mg/L". The Action Board shows the new sensor and lets me enter a sensor reading - 1.5 mg/L.

    Does that make sense?



  • @jkandasa you currently support updating OTA firmware with MYSbootloader.
    what about the sensebender boards the the DualOptiboot-bootloader?


  • Plugin Developer

    @mvader said:

    @jkandasa you currently support updating OTA firmware with MYSbootloader.
    what about the sensebender boards the the DualOptiboot-bootloader?

    @mvader I do not have hardware to test DualOptiboot-bootloader till now. I waiting for it. Meantime if any one ready to test this feature I will implement DualOptiboot-bootloader support on MyController next release. I have created a feature request for this task. Kindly add your thoughts on this request.
    https://github.com/mycontroller-org/mycontroller/issues/25


  • Hardware Contributor

    @jkandasa said:

    @TD22057 The current MQTT gateway supports only limited features and a big drawback is we cannot use it directly on internet as it does not have any security option and limited to number of connections

    For this reason I'm implementing MQTT broker support in MyController server. Here we can connect our mysensors gateway (serial/Ethernet) to MyController. Connect all our MQTT client to MyController with authentication

    https://github.com/mycontroller-org/mycontroller/issues/7

    I'm sure I'm not understanding something, but isn't that a lot more complicated than it needs to be? Why isn't MyController just an MQTT client that connects to an existing broker? So Arduinos <-> MQTTClientGateway <-> Mosquitto <-> MyController. If MyController subscribes to the MS messages from the broker and publishes command messages to the broker, everything works fine. Security and everything else is already handled by the existing broker software (Mosquitto).


  • Plugin Developer

    @TD22057 said:

    I'm sure I'm not understanding something, but isn't that a lot more complicated than it needs to be? Why isn't MyController just an MQTT client that connects to an existing broker? So Arduinos <-> MQTTClientGateway <-> Mosquitto <-> MyController. If MyController subscribes to the MS messages from the broker and publishes command messages to the broker, everything works fine. Security and everything else is already handled by the existing broker software (Mosquitto).

    @TD22057 MyController supports MQTT gateway(connects with existing broker) also but with limited feature. The current MQTTClientGateway doesn't support firmware upgrade and some other features which is required to use all the features in MyController. So if we use Serial/Ethernet gateway we can use all the features from MyController at the same time I do not want to restrict people with MyController, So if I provide MQTT broker they can connect all their clients with MyController.



  • @jkandasa Great. I just tried it. I used send on the activity board and it appears to be doing what i meant by Receive. Of course once you fix that "bug" it may not work like that anymore.

    But I did see the data on the chart.


  • Plugin Developer

    @bpair said:

    @jkandasa Great. I just tried it. I used send on the activity board and it appears to be doing what i meant by Receive. Of course once you fix that "bug" it may not work like that anymore.

    But I did see the data on the chart.

    @bpair As I mentioned on the bug, that's all users wish they can disable/enable payload option. After the fix also still you can feed your data via action board (if you enabled send payload option). I hope for now your requirement fulfilled.



  • Thanks. Everything looks very good.



  • Good afternoon. tell me why issue such a mistake?
    Good afternoon. tell me why issue such a mistake?
    I understand that the resulting package is less, but I use the default gateway mysensors MQTT.
    help solve this problem.

    2015-10-27 22:47:52,574 DEBUG [MQTT Call: MC] [org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener:84] Message Received, Topic:[MyMQTT/20/0/V_LIGHT], PayLoad:[1]
    2015-10-27 22:47:52,576 ERROR [MQTT Call: MC] [org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener:92] Exception,
    org.mycontroller.standalone.mysensors.RawMessageException: Unknown message format, Topic:MyMQTT/20/0/V_LIGHT, PayLoad:1
            at org.mycontroller.standalone.mysensors.RawMessage.<init>(RawMessage.java:62) ~[mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener.messageArrived(MqttCallbackListener.java:85) ~[mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:354) [mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:162) [mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
    2015-10-27 22:47:55,114 DEBUG [MQTT Call: MC] [org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener:84] Message Received, Topic:[MyMQTT/20/0/V_LIGHT], PayLoad:[0]
    2015-10-27 22:47:55,115 ERROR [MQTT Call: MC] [org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener:92] Exception,
    org.mycontroller.standalone.mysensors.RawMessageException: Unknown message format, Topic:MyMQTT/20/0/V_LIGHT, PayLoad:0
            at org.mycontroller.standalone.mysensors.RawMessage.<init>(RawMessage.java:62) ~[mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener.messageArrived(MqttCallbackListener.java:85) ~[mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:354) [mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:162) [mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
    2015-10-27 22:48:33,356 DEBUG [MQTT Call: MC] [org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener:84] Message Received, Topic:[MyMQTT/3/255/V_SKETCH_NAME], PayLoad:[EgHumBarTemBat_v2]
    2015-10-27 22:48:33,358 ERROR [MQTT Call: MC] [org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener:92] Exception,
    org.mycontroller.standalone.mysensors.RawMessageException: Unknown message format, Topic:MyMQTT/3/255/V_SKETCH_NAME, PayLoad:EgHumBarTemBat_v2
            at org.mycontroller.standalone.mysensors.RawMessage.<init>(RawMessage.java:62) ~[mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener.messageArrived(MqttCallbackListener.java:85) ~[mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:354) [mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:162) [mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
    2015-10-27 22:48:33,377 DEBUG [MQTT Call: MC] [org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener:84] Message Received, Topic:[MyMQTT/3/255/V_SKETCH_VERSION], PayLoad:[2.2 19.10.2015]
    2015-10-27 22:48:33,378 ERROR [MQTT Call: MC] [org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener:92] Exception,
    org.mycontroller.standalone.mysensors.RawMessageException: Unknown message format, Topic:MyMQTT/3/255/V_SKETCH_VERSION, PayLoad:2.2 19.10.2015
            at org.mycontroller.standalone.mysensors.RawMessage.<init>(RawMessage.java:62) ~[mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.mycontroller.standalone.gateway.mqtt.MqttCallbackListener.messageArrived(MqttCallbackListener.java:85) ~[mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:354) [mycontroller-standalone-0.0.2-alpha5-single.jar:na]
            at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:162) [mycontroller-standalone-0.0.2-alpha5-single.jar:na]
    
    

  • Plugin Developer

    @artur said:

    Good afternoon. tell me why issue such a mistake?
    Good afternoon. tell me why issue such a mistake?
    I understand that the resulting package is less, but I use the default gateway mysensors MQTT.
    help solve this problem.

    Log message says that you are using MyController 0.0.2-alpha5(mycontroller-standalone-0.0.2-alpha5). This version of MyController supports only for MySensors-1.6 dev branch. And the MQTT format should be MY_MQTT_TOPIC_PREFIX/NODE-ID/SENSOR-ID/CMD-TYPE/ACK-FLAG/SUB-TYPE

    Refer this for more details: https://github.com/mycontroller-org/mycontroller/issues/33



  • what is the point to move to 1.6 when gateway may only client?


  • Plugin Developer

    @artur said:

    what is the point to move to 1.6 when gateway may only client?

    @artur Not only gateway will be client, we have other features like Get node details without reboot(via I_PRESENTATION), ping status for node(heartbeat), MQTT full support (supports all the commands, you can do firmware update also), like we have many features available in 1.6. Anyhow we have to support all the features once 1.6 released. Hence I started implementing 1.6 features slowly one by one.



  • certainly it sounds tempting, but I just could not find in the examples, see only MQTT client initially.
    https://github.com/mysensors/Arduino/tree/development/libraries/MySensors/examples
    I realized 1.6 is still in development?


  • Plugin Developer

    @artur said:

    certainly it sounds tempting, but I just could not find in the examples, see only MQTT client initially.
    https://github.com/mysensors/Arduino/tree/development/libraries/MySensors/examples
    I realized 1.6 is still in development?

    @artur Yes, 1.6 is in development branch. you can find MQTT client here



  • and who will MQTT broker?


  • Plugin Developer

    @artur said:

    and who will MQTT broker?

    You are right! I misunderstood something here! I believe I have to create code for MQTT broker with MyController

    http://forum.mysensors.org/topic/2285/mqtt-broker-support-in-mysensors-1-6


Log in to reply
 

Suggested Topics

  • 17
  • 1
  • 9
  • 1
  • 1

24
Online

11.2k
Users

11.1k
Topics

112.5k
Posts