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
JapioJ

Japio

@Japio
Hardware Contributor
About
Posts
23
Topics
7
Shares
0
Groups
1
Followers
0
Following
0

Posts

Recent Best Controversial

  • Fritzing and OpenHardware.IO
    JapioJ Japio

    Hi all,

    Probably the in the wrong category, but I am in the process of adding my project to Openhardware.io, and run into the following problem:

    I created the schematic and PCB in fritzing. How do I export the BOM list to OpenHardware.io? As only csv format is accepted, and fritzing only produces HTML files

    Hardware

  • ESP8266 gateway + WebServer = Awesome!
    JapioJ Japio

    Yes, it actually is.

    Current features:

    • Stores wifi and mqtt broker configuration in flash. When no configuration is found, or the flash button of the ESP is pressed for 10 seconds, released, and then the reset button is pressed, it will restart in access point mode, allowing configuration to be done.
    • Status page shows all nodes and sensors connected and the last sensors data and presentation time.
    • Status indications on the box itself using a neopixel stick of 8 leds:
      • Gateway status (operation or access point mode)
      • Wifi strength
      • Mqtt connection status
      • Transmit error
      • Receive indication.

    I designed a board to nicely fit in a standard Aliexpress housing.

    Main problem still is the instability of the ESP, it resets often, and I tried to work around it by maikng sure it resets quickly.

    I am planning to make a more elaborate topic, including board designs soon.

    Development

  • Using before()
    JapioJ Japio

    One more thing I just found out: if I take out the walking-light from the setup_led() it works fine as well.

    As this takes some time, might there be some kind of race condition during initialization of the MySensors stack?

    Development

  • Using before()
    JapioJ Japio

    I installed 2.2.0 beta and indeed something has changed, but nothing that helps me:

    Placed the setup_led() in before():

    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGE--,VER=2.2.0-beta
    0;255;3;0;9;MCO:BGN:BFR
    scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 8
    cnt 
    
    connected with XXXX, channel 6
    dhcp client start...
    ip:192.168.X.x,mask:255.255.255.0,gw:192.168.X.X
    Going to MySensors Application mode
    - Broker Ip Address: 192.168.X.X
    - Broker Port: 1883
    - Network name: XXXX
    0;255;3;0;9;TSF:LRT:OK
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    f r0, scandone
    .....0;255;3;0;9;TSF:MSG:READ,20-20-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:BC
    0;255;3;0;9;TSF:MSG:FPAR REQ,ID=20
    0;255;3;0;9;TSF:PNG:SEND,TO=0
    0;255;3;0;9;TSF:CKU:OK
    0;255;3;0;9;TSF:MSG:GWL OK
    0;255;3;0;9;TSF:MSG:SEND,0-0-20-20,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    ...0;255;3;0;9;TSF:MSG:READ,20-20-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    0;255;3;0;9;TSF:MSG:PINGED,ID=20,HP=1
    0;255;3;0;9;TSF:MSG:SEND,0-0-20-20,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    ..0;255;3;0;9;TSF:MSG:READ,20-20-0,s=6,c=1,t=17,pt=7,l=5,sg=0:2660
    0;255;3;0;9;TSF:MSG:READ,20-20-0,s=7,c=1,t=17,pt=7,l=5,sg=0: 0
    pm open,type:2 0
    .....................0;255;3;0;9;TSF:MSG:READ,20-20-0,s=6,c=1,t=17,pt=7,l=5,sg=0:2590
    0;255;3;0;9;TSF:MSG:READ,20-20-0,s=7,c=1,t=17,pt=7,l=5,sg=0: 0
    .....................0;255;3;0;9;TSF:MSG:READ,20-20-0,s=6,c=1,t=17,pt=7,l=5,sg=0:2590
    0;255;3;0;9;TSF:MSG:READ,20-20-0,s=7,c=1,t=17,pt=7,l=5,sg=0: 0
    ..................
    

    Well, anyway. I moved the setup_led function to the setup() so I am ok for now. But this is still a weird situation.

    Development

  • Using before()
    JapioJ Japio

    Hi,

    Indeed it is 2.0.1 beta.

    Yes, I 'll try tonight, and report back on the result.

    Thanks.

    Development

  • Using before()
    JapioJ Japio

    Hi,

    I have created a "MyVersion" of the ESP8266 Mqtt gateway. To show detailed state of the gateway (things like message received, message sent, wifi connection and strength) I connected a Neopixel Stick (8 RGB leds) to the ESP8266.

    To initialize the leds I created a function setup_leds() that initializes the Neopixel library and does some sort of walking light across the RGB colors of each LED.

    So far no problems.

    However, when I call the setup_leds() from the void before() function, the gateway is not able to get an IP address. If I move this call to setup() it does get an ip address.

    This output is with setup_leds() in before():

    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGE--,VER=2.0.1-beta
    0;255;3;0;9;MCO:BGN:BFR
    scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 8
    cnt 
    
    connected with XXXX, channel x
    dhcp client start...
    ip:192.168.X.XX,mask:255.255.255.0,gw:192.168.X.XXX
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY
    f r0, scandone
    .pm open,type:2 0
    ............................................................................
    

    This reproduces 100% of the time. My question is: What is the problem here? Is it possible to use the before? Are there time constraints on placing code in before()?

    Development

  • ESP8266 MQTT client dynamically changing MQTT broker settings
    JapioJ Japio

    Hi,

    I am working on an ESP8266 MQTT gateway with a web interface to allow th user to configure settings. One of these settings is the MQTT broker IP address and port number.

    In the before() I read out the IP address from EEPROM and want to set it in the gateway software, and not as normally done by defining MY_CONTROLLER_IP_ADDRESS.

    Is it possible to do this?

    I already tried to declare _ethernetControllerIP as external. This doesn't work.
    Also tried to skip de definition MY_CONTROLLER_IP_ADDRESS and declar it in the gateway sketch. Didn't work either.:disappointed_relieved:

    Development

  • Smartmeter sensors
    JapioJ Japio

    @rwanrooy : I used AltSoftSerial for the smartmeter sensor, because it has only 1 uart for serial communication, which is used for firmware upload/download. That is why I used the software alternative. But if it actually is the arduino MEGA 2560, it has 4 uarts, one for the firmware download (serial 0), but the other 3 are at your service (looking at the documentation, I don't know the details.)

    These hardware ports should better be able to handle the 115200 baud.

    My Project

  • Smartmeter sensors
    JapioJ Japio

    @sincze You can find it on: https://github.com/Japio74/MysSmartmeterGateway

    |t currently already is 2.0.0.

    Enjoy it!

    My Project

  • Smartmeter sensors
    JapioJ Japio

    @sincze : Good to see you used my program! :smiley: I also changed some things, I added some sleeps in between the presentation messages, as I got a lot of failures during presentation. And I removed all the timers between sending updates.

    Now, I send the current usage and production on every new update, and the rest only when the timestamp of the gasmeter changes (at the start of every hour) I also commented out sending the timestamp of the gasmeter and main switch.

    My Project

  • Reset node from gateway
    JapioJ Japio

    Hi,

    As part of my ESP8266 MQTT gateway with web page project I added an overview of all presented nodes with timestamp of presentation and so forth. And a button to reset that specific node. Might come in handy for whatever reason.

    My code looks like this:

      MyMessage rstMsg(255, C_INTERNAL);
      mSetCommand(rstMsg, C_INTERNAL);
      rstMsg.type = I_REBOOT;
      rstMsg.destination = node;
    

    and the resulting info in the serial monitor is:

    0;255;3;0;9;TSF:MSG:SEND,0-0-20-20,s=255,c=1,t=13,pt=0,l=0,sg=0,ft=0,st=OK:
    

    But still the node does not reset (and send a new presentation packet) What am I doing wrong here?

    Note: This is for node 20, and I send the command to sensor 255 (arduino sensor)

    Development

  • ESP8266 gateway + WebServer = Awesome!
    JapioJ Japio

    Yes, this works!

    0;255;3;0;9;TSF:MSG:READ,20-20-0,s=255,c=3,t=15,pt=2,l=2,sg=0:0
    0;255;3;0;9;TSF:MSG:SEND,0-0-20-20,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    0;255;3;0;9;TSF:MSG:READ,20-20-0,s=255,c=0,t=17,pt=0,l=5,sg=0:1.5.3
    0;255;3;0;9;Sending message on topic: mygateway1-out/20/255/0/0/17
    @@@@@@@#####@@@@@Message
    0;255;3;0;9;TSF:MSG:READ,20-20-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    0;255;3;0;9;Sending message on topic: mygateway1-out/20/255/3/0/6
    @@@@@@@#####@@@@@Message
    0;255;3;0;9;TSF:MSG:READ,20-20-0,s=255,c=3,t=11,pt=0,l=10,sg=0:Smartmeter
    0;255;3;0;9;Sending message on topic: mygateway1-out/20/255/3/0/11
    @@@@@@@#####@@@@@Message
    0;255;3;0;9;TSF:MSG:READ,20-20-0,s=255,c=3,t=12,pt=0,l=3,sg=0:0.1
    0;255;3;0;9;Sending message on topic: mygateway1-out/20/255/3/0/12
    @@@@@@@#####@@@@@Message
    0;255;3;0;9;TSF:MSG:READ,20-20-0,s=1,c=0,t=13,pt=0,l=0,sg=0:
    0;255;3;0;9;Sending message on topic: mygateway1-out/20/1/0/0/13
    @@@@@@@#####@@@@@Message
    0;255;3;0;9;TSF:MSG:READ,20-20-0,s=2,c=0,t=13,pt=0,l=0,sg=0:
    0;255;3;0;9;Sending message on topic: mygateway1-out/20/2/0/0/13
    @@@@@@@#####@@@@@Message
    0;255;3;0;9;TSF:SANCHK:OK
    

    The @@@@###@@@ Message is printed in my receive() function!

    Awesome. :smile:

    Development

  • ESP8266 gateway + WebServer = Awesome!
    JapioJ Japio

    Great! This will be added.

    I am going to continue with the node and sensor status tomorrow.

    Development

  • ESP8266 gateway + WebServer = Awesome!
    JapioJ Japio

    No, it worked right out of the box, something that surprised me as well.

    You do need Mysensors 2.0 for this.

    You can check if you have a myindication.h file in the source tree of the Mysensors library. That file also contains the indications sent.

    Development

  • ESP8266 gateway + WebServer = Awesome!
    JapioJ Japio

    Yes, I see the difference. I'll try the bèta version tomorrow.

    Development

  • ESP8266 gateway + WebServer = Awesome!
    JapioJ Japio

    @Yveaux ok, thanks, I just have learned something ;-)

    So I can assume the receive function is not called from the library then? So which function is called, on reception of data from a node?

    Development

  • ESP8266 gateway + WebServer = Awesome!
    JapioJ Japio

    Hmm I implemented a receive function like this:

    void receive(const MyMessage &message)
    {
      Serial.println("@@@@@@@#####@@@@@Message");
      
    }
    

    And when I connect my smartmeter sensor I get the following output in the serial console of my MQTT gateway:

    0;255;3;0;9;TSP:MSG:READ 20-20-0 s=6,c=1,t=17,pt=7,l=5,sg=0:350
    0;255;3;0;9;Sending message on topic: mygateway1-out/20/6/1/0/17
    0;255;3;0;9;TSP:MSG:READ 20-20-0 s=7,c=1,t=17,pt=7,l=5,sg=1: 0
    0;255;3;0;9;Sending message on topic: mygateway1-out/20/7/1/0/17
    

    So I assume the receive function is not called?

    Still, as with the indication function it is fuzzy to me how it i possible that a function is called when it is implemented, but the compiler does not complain when it is not :confused:

    Is this some kind of inheritance relation?

    Development

  • ESP8266 gateway + WebServer = Awesome!
    JapioJ Japio

    @hek Indeed, the ESP has both plenty of processing power and memory compared to the arduino.

    This implementing a receive method, is that a method I can implement in my sketch, with a specific name and signature, and it will be called automatically (like the indication handler)? or does it require changes in de library code? Sounds promising, I can just take out the data I need and store it in a separate structure until the webpage is requested.

    Another thing I found "somewhere on the Internet" is an ESP8266 program that, when the wifi connection is not established, or the stored network SSID and password are empty, places the ESP in Access point mode. You can connect to this wifi network and configure the wifi settings. That way you don't need your SSID and password in the sketch.

    Too many things to do, and too little time I am afraid.:grinning:

    Development

  • Questions on using the forum
    JapioJ Japio

    I tried to reproduce, did not happen again.

    I am not using a mobile device, just Firefox in windows 10. But as I said now it works.

    Quite frustrating when you can't see what you're typing.....

    Thanks for your response.

    General Discussion

  • ESP8266 gateway + WebServer = Awesome!
    JapioJ Japio

    @Yveaux thanks for formatting the code.

    Would it be possible to get the list of registered nodes and sensors for example?

    Development
  • Login

  • Don't have an account? Register

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