[RESOLVED] Send text to node with OLED display



  • Hi.
    I am trying (without success) to send text from the controller to a node with a OLED display.
    The node registers successfully with the controller, gets an IDx of 8, and is enablad
    I am trying to send a text value (a temperature from another node actually) to be displayed, using JSON
    An example command is http://192.168.1.13:8080/json.htm?type=command&param=udevice&idx=8&nvalue=0&svalue=hello
    The text shows in the device list in domoticz, but the receive() function never fires.
    0_1483816451561_Capture1.PNG

    This is my receive() function

    void receive(const MyMessage &message) {
      Serial.print("Sensor: "); Serial.print(message.sensor); Serial.print(", Message: "); Serial.println(message.getString()); 
      if (message.type == V_TEXT) { 
        if (message.sensor == OLED_CHILD) {
          OLEDtemp = message.getString();
        }
      }
    }
    
    

    I also tried passing the value to the node via a LUA script, without results.
    What am I doing wrong?


  • Mod

    @kted are you using MySensors v 2.0 and the node is also a gateway? If so, upgrade to MySensors 2.1. If I remember correctly 2.0 had a bug that caused receive to not be called on gateways.



  • MySensors 2.0, and the node is just an Arduino Pro mini with a NRF24 and an OLED display. No other function is enabled on it.
    I use it to display the solar water heater temperature next to the switch that powers the heater when solar power cannot heat the water enough.
    The sending node is several floors away, and communicates successfully with the gateway, using NRF2401 PA modules.

    In the past I was able to succesfully send messages from node to node, and they were shown on the display, but now the distance is too great, and the receiving node has no external antenna.

    Thanks for the suggestion. I will upgrade the controller and this node to 2.1, and see what happens.
    Will there be a problem if the other nodes (about 8 of them) remain at the 2.0 version for a while, until I upgrade all of them?


  • Mod

    @kted you can mix 2.0 and 2.1, no need to upgrade all nodes.
    However, since this is just a regular node and not a gateway, I don't think upgrading will solve the problem.

    Could you capture and post debug log from the node and the gateway when sending the message from Domoticz? It might help figure out what is going wrong.

    You could also try requesting the value of the variable from the node. See https://www.openhardware.io/view/23/In-wall-LCD-SwitchScene-controller-for-MySensors#tabs-source for an example, especially this line:

    request(msg_v_Text, V_TEXT, 0);
    


  • Duh!
    Just realized that the node is sleeping while waiting for the message!
    There are no debug messages while waiting, the node just sleeps.
    What threw me off, was that the time and date are received OK, but that was at the beginning of the first loop, while the node was awake.
    I'll try the request() function ASAP.
    Thanks.


Log in to reply
 

Suggested Topics

  • 5
  • 1
  • 2
  • 8
  • 4
  • 5

1
Online

11.4k
Users

11.1k
Topics

112.7k
Posts