Frustrated Newbie - Help with Nodes and Sensors


  • MOD

    @emenike

    Make sure that the same baudrate is used in the gateway sketch and mycontroller.....



  • @tag
    😭 but that was exactly how it was until you said to change 38400 …. but it connected alright after | changed to 38400 and brought the node next to the laptop.



  • @emenike said in Frustrated Newbie - Help with Nodes and Sensors:

    @skywatch Thanks @skywatch

    Please note that I am using a Nano for my gate way...
    I thought the baud rate should be the same for Arduino and the Putty sniffer, I will revert to "38400"...

    That part of the gateway sketch is an 'If' statement. It just tells the compilier that 'if' the board is a 3.3v 8MHz type, then reduce the baud rate to match. 8MHz boards are not reliable at 115200.


  • MOD

    @emenike

    Okay so if I understand correctly, all works if the nodes are basically next to each other... is that correct?



  • @tag Yes! All works well when they are next to each other on the same desk.
    I have reverted the default baud rate and all is well. I have gone ahead to create Triggers and Conditions, Schedules, Actions, etc. But I somehow can not seem to tie all up to do what I want.

    I want to do a whole lot of things, but lets start with the first one. I need to pull in time and date from the controller to my node. How do I do this? Can I have a simple example that shows the steps or syntax and I will try to do other stuff. The Mysensors node uses a project that pulls data from Weather Underground, which I learnt has stopped its free weather information services. I have researched the topic and found a likely alternative in Open Weather Service) . Is anyone using Open Weather? https://openweathermap.org/current)

    1. I need to create Actions (or triggers that target all 8 objects from my node and set them all "on".
    2. I need to create another action trigger that targets all 8 objects and sets them to "off"
    3. I need to create an action trigger cycles through each value on the node and turn them on for a duration I have a variable in the Controller on each value to determine how long each one will run. Its a whole lot, and it appears I may have bitten off more than I can chew.


  • @emenike

    To receive time in your node, you have to call requestTime(); from your node, then you will receive time on the following function(add this in your node code),

    void receiveTime(unsigned long _timestamp){
       // do actions with received time
    }
    

    I need to create Actions (or triggers that target all 8 objects from my node and set them all "on".

    You need to create 8 Operations for each object. Send payload operation with 1(ON), Add all of them in a rule. define your condition in the rule.

    I need to create another action trigger that targets all 8 objects and sets them to "off"

    You need to create 8 Operations for each object. Send payload operation with 0(OFF), Add all of them in a rule. define your condition in the rule.

    I need to create an action trigger cycles through each value on the node and turn them on for a duration I have a variable in the Controller on each value to determine how long each one will run. Its a whole lot, and it appears I may have bitten off more than I can chew.

    Seems this is complex, we may not easy by simple rule definition/timer. A script will be a good solution for this.

    Some of the discussions,
    https://forum.mycontroller.org/topic/45/timers-and-scripts
    https://forum.mycontroller.org/topic/262/how-to-automatically-turn-off-relay-after-defined-time



  • Thanks @jkandasa you are awesome support. I see the requestTime() function call in the sketch, but where in MyController do I add the node code?

    void receiveTime(unsigned long _timestamp){
       // do actions with received time
    }
    


  • I have created the UID Tags... See below, did I do it right?UID Tags.png

    I then tried to create the JS script as described in your old reference you supplied... but I got an error.

    RunQuery Error.png

    What are I doing wrong?



  • @Emenike

    I see the requestTime() function call in the sketch, but where in MyController do I add the node code?

    This code needs to be added to your MySensors node sketch, the example in your sprinkler sketch.
    Nothing to do with MyController to receive timestamp.



  • @Emenike said in Frustrated Newbie - Help with Nodes and Sensors:

    I then tried to create the JS script as described in your old reference you supplied... but I got an error.

    Did you modify the script? If yes, can you post your script?

    If not, you have to create all the UID, valve-status is not available in your UID's list also Value 1 is different then value01


 

Suggested Topics

16
Online

407
Users

371
Topics

2.3k
Posts