<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Getting V_FORECAST on a node from  controller?]]></title><description><![CDATA[<p dir="auto">HI all!</p>
<p dir="auto">I have been trying to get the V_FORECAST to another node (not the originating node). I have set up the payload forward in MyController, but I am having a problem getting it to work on the receiving node.</p>
<p dir="auto">I have tried various variations on....</p>
<pre><code>void receive(const MyMessage &amp;message) {
    if (message.sensor == CHILD_ID_GETFORECAST &amp;&amp; message.type == V_FORECAST){
    FORECAST = (message.getInt());   
    }
</code></pre>
<p dir="auto">including getByte and getString. But still I can't seem to get it to work.</p>
<p dir="auto">So what is the correct way to get relayed V_FORECAST on a node?</p>
]]></description><link>http://forum.mycontroller.org/topic/333/getting-v_forecast-on-a-node-from-controller</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 02:36:19 GMT</lastBuildDate><atom:link href="http://forum.mycontroller.org/topic/333.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 22 Aug 2018 15:08:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Getting V_FORECAST on a node from  controller? on Sun, 23 Feb 2020 12:53:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/skywatch" aria-label="Profile: skywatch">@<bdi>skywatch</bdi></a> Just a quick update - ......</p>
<p dir="auto">Keep the receive section clean - I took all the 'if' and 'elseif' out of receive and into the main loop - This is good practice. So now it looks like this......</p>
<pre><code>// process incoming message
void receive(const MyMessage &amp;message) {
  if (message.sensor == CHILD_ID_GETFORECAST &amp;&amp; message.type == V_FORECAST) {
    forecast = (message.getString());
    NewForecast = 1;
  }
}
</code></pre>
<p dir="auto">The NewForecast is there to alert the main loop to a new incomming value to be tested and updated.</p>
]]></description><link>http://forum.mycontroller.org/post/2702</link><guid isPermaLink="true">http://forum.mycontroller.org/post/2702</guid><dc:creator><![CDATA[skywatch]]></dc:creator><pubDate>Sun, 23 Feb 2020 12:53:12 GMT</pubDate></item><item><title><![CDATA[Reply to Getting V_FORECAST on a node from  controller? on Thu, 23 Aug 2018 17:13:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jkandasa" aria-label="Profile: jkandasa">@<bdi>jkandasa</bdi></a></p>
<p dir="auto">Thanks I got it to work!</p>
<p dir="auto">The below is what I used as I cannot display the full message on a small oled and so I use abbreviations held in an array. Therefore I needed to get a value to act as a pointer to the message to display and the below did the trick! - Node finished! <img src="http://forum.mycontroller.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=2ce0f5c73bf" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<pre><code>void receive(const MyMessage &amp;message) {
   if (message.sensor == CHILD_ID_GETFORECAST &amp;&amp; message.type == V_FORECAST) {
    forecast = (message.getString());
    if (forecast == "stable"){
    Index = 0;}
    else if (forecast == "sunny"){
    Index = 1;}
    else if (forecast == "cloudy"){
    Index = 2;}
    else if (forecast == "unstable"){
    Index = 3;}
    else if (forecast == "thunderstorm"){
    Index = 4;}
    else if (forecast == "unknown"){
    Index = 5;}
 
  }
</code></pre>
]]></description><link>http://forum.mycontroller.org/post/2005</link><guid isPermaLink="true">http://forum.mycontroller.org/post/2005</guid><dc:creator><![CDATA[skywatch]]></dc:creator><pubDate>Thu, 23 Aug 2018 17:13:32 GMT</pubDate></item><item><title><![CDATA[Reply to Getting V_FORECAST on a node from  controller? on Thu, 23 Aug 2018 03:53:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/skywatch" aria-label="Profile: skywatch">@<bdi>skywatch</bdi></a></p>
<blockquote>
<p dir="auto">I do not know what that is - is it an int? byte?string?</p>
</blockquote>
<p dir="auto">MyController receives all the payload in String format and sends all the payload in String format.<br />
From the gateway, MyController receives payload as String, <a href="https://www.mysensors.org/download/serial_api_20" rel="nofollow ugc">https://www.mysensors.org/download/serial_api_20</a><br />
However, We have multiple functions in MySensors, based on your payload you can call a particular function,<br />
<a href="https://www.mysensors.org/download/sensor_api_20#message-constructor" rel="nofollow ugc">https://www.mysensors.org/download/sensor_api_20#message-constructor</a></p>
<pre><code> // Getters for picking up payload on incoming messages
    char* getStream(char *buffer) const;
    char* getString(char *buffer) const;
    const char* getString() const;
    void* getCustom() const;
    uint8_t getByte() const;
    bool getBool() const;
    float getFloat() const;
    long getLong() const;
    unsigned long getULong() const;
    int getInt() const;
    unsigned int getUInt() const;
</code></pre>
<p dir="auto">Can you check it in the resources page, do you receive data from the source node? You can enable <code>Notice</code> and check activities in resources log page.</p>
]]></description><link>http://forum.mycontroller.org/post/2003</link><guid isPermaLink="true">http://forum.mycontroller.org/post/2003</guid><dc:creator><![CDATA[jkandasa]]></dc:creator><pubDate>Thu, 23 Aug 2018 03:53:07 GMT</pubDate></item><item><title><![CDATA[Reply to Getting V_FORECAST on a node from  controller? on Wed, 22 Aug 2018 19:41:26 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/skywatch" aria-label="Profile: skywatch">@<bdi>skywatch</bdi></a> MyController sends payload as is.</p>
</blockquote>
<p dir="auto">I do not know what that is - is it an int? byte?string?</p>
<blockquote>
<p dir="auto">Can you double check that, you have configured right sensor?</p>
</blockquote>
<p dir="auto">Yes I have, I can send the receiving node a byte and the screen displays the correct value. I did this to test with action&gt;send raw message and it was good.</p>
<blockquote>
<p dir="auto">You may debug by adding a serial print line right after <code>void receive(const MyMessage &amp;message) {</code> before <code>if</code> loop?</p>
</blockquote>
<p dir="auto">That's a thought for tomorrow.....thanks!</p>
]]></description><link>http://forum.mycontroller.org/post/2002</link><guid isPermaLink="true">http://forum.mycontroller.org/post/2002</guid><dc:creator><![CDATA[skywatch]]></dc:creator><pubDate>Wed, 22 Aug 2018 19:41:26 GMT</pubDate></item><item><title><![CDATA[Reply to Getting V_FORECAST on a node from  controller? on Wed, 22 Aug 2018 18:29:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/skywatch" aria-label="Profile: skywatch">@<bdi>skywatch</bdi></a> MyController sends payload as is.<br />
Can you double check that, you have configured right sensor?<br />
You may debug by adding a serial print line right after <code>void receive(const MyMessage &amp;message) {</code> before <code>if</code> loop?</p>
]]></description><link>http://forum.mycontroller.org/post/2001</link><guid isPermaLink="true">http://forum.mycontroller.org/post/2001</guid><dc:creator><![CDATA[jkandasa]]></dc:creator><pubDate>Wed, 22 Aug 2018 18:29:29 GMT</pubDate></item><item><title><![CDATA[Reply to Getting V_FORECAST on a node from  controller? on Wed, 22 Aug 2018 17:02:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jkandasa" aria-label="Profile: jkandasa">@<bdi>jkandasa</bdi></a> Sure I can! <img src="http://forum.mycontroller.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=2ce0f5c73bf" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto"><img src="/assets/uploads/files/1534957294190-forward-resized.jpg" alt="0_1534957288554_Forward.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">I think I have the wrong variable type to get V_FORECAST - Although I only need a byte or int with the index pointer of the current forecast (0-5).</p>
<p dir="auto">When testing it with byte received I could send a raw message and it worked, so I guess it is not a byte or int that is sent to the controller and then on to the node?</p>
]]></description><link>http://forum.mycontroller.org/post/2000</link><guid isPermaLink="true">http://forum.mycontroller.org/post/2000</guid><dc:creator><![CDATA[skywatch]]></dc:creator><pubDate>Wed, 22 Aug 2018 17:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to Getting V_FORECAST on a node from  controller? on Wed, 22 Aug 2018 16:13:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/skywatch" aria-label="Profile: skywatch">@<bdi>skywatch</bdi></a> can you paste the screenshot of forward payload configuration?</p>
]]></description><link>http://forum.mycontroller.org/post/1999</link><guid isPermaLink="true">http://forum.mycontroller.org/post/1999</guid><dc:creator><![CDATA[jkandasa]]></dc:creator><pubDate>Wed, 22 Aug 2018 16:13:49 GMT</pubDate></item></channel></rss>