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
J

Joost

@Joost
About
Posts
59
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • 💬 Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node
    J Joost

    @evb said in 💬 Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node:

    Thanks for the dimensions :-)
    That will work in my setup!

    I have read also these links with results much better then my 133µA.
    I have tested my pro mini with the lowpower sketch to get the pro mini in deep sleep and I measure 133µA. My multimeter is already 30 years old and his last calibration was 20 years ago? But the voltage measurements are still correct, so I don't know...
    LowpowerLab has a Current Sense Amplifier device, but for 141 euros it is bit expensive ;-)

    You didn't mention where you did buy your Pro Mini's? I'm thinking about the quality of the used electronics...

    @evb I don't have a specific source for my Pro Minis. Some are from Ali, some from Ebay international - I don't even know which one is from where. I just keep sure to always order the same layout/design, as can be seen in the photos.
    Also, when the regulator and LED are removed, there is not that much left besides the ATMega328 itself, is there? Some resonators, but not any questionable parts AFAICS.
    Perhaps you should really give another multimeter a try?

    OpenHardware.io rfm95 pro mini bme280 mysensors

  • 💬 Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node
    J Joost

    Maybe we are comparing deep sleep current vs. a "mix" of deep sleep and wake times added together and averaged? See differences between those approaches in the first

    See "calculation"

    vs. these last two links:

    See table "The Simple @ 8Mhz"

    Sparkfun article

    OpenHardware.io rfm95 pro mini bme280 mysensors

  • 💬 Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node
    J Joost

    Or am I measuring nonsense/inaccurately? Just a hobbyist...
    If so, sorry for that

    OpenHardware.io rfm95 pro mini bme280 mysensors

  • 💬 Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node
    J Joost

    Hi, with a newer, potentially better DMM I found 12.4µA at 3.3V for a Pro Mini (3.3/8MHz, regulator and power LED removed, stock bootloader) with a BME280 (which has an additional, in this 3.3V setting unneeded, power regulator on board that could be removed) and a RFM95/96, at deep sleep.
    Also I got you some pic of the dimensions for that older version of the board I had lying around.
    Cheers, Joost

    PXL_20201121_121708555.jpg PXL_20201121_121643304.jpg ProMini-BME280-RFM95.jpg

    OpenHardware.io rfm95 pro mini bme280 mysensors

  • 💬 Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node
    J Joost

    HI, I'll try to get back to you this weekend and re-measure my power consumption (you're correct, these are unmodified 8MHz/3.3V Pro Minis, no modified bootloader or anything). The consumption was measured with two relatively cheap multimeters, giving the same result (in comparison to your link without the DS18B20 and with a RFM95), though I'm pretty confident this would be kind of correct.

    Btw. you mean the thickness of the radio module on its own?

    OpenHardware.io rfm95 pro mini bme280 mysensors

  • Thanks for node-red-contrib-mysensors and a question regarding collections or arrays
    J Joost

    This seems to evaluate to true/undefined every time, effectively resetting the array:

    var global_individual_data=global.get("global_invidual_data");
    if (global_individual_data===undefined) {
        msg.kein_array_vorhanden="true"
        global_individual_data=[];
    }
    

    even though it's later set with

    global.set("global_individual_data",global_individual_data);
    
    Node-RED

  • Thanks for node-red-contrib-mysensors and a question regarding collections or arrays
    J Joost

    HI, thanks, I guess right now the problem lies in the data storage in global or flow context.
    With this I can build the individual obejct, and pushing it on a global array gives no error. But the array is not properly stored and retrieved from the global context:

    var ind_data={};
    ind_data.nodeid=msg.nodeId;
    ind_data.type=msg.type;
    ind_data.payload=msg.payload;
    
    var global_individual_data=global.get("global_invidual_data");
    if (global_individual_data===undefined) {
        msg.kein_array_vorhanden="true"
        global_individual_data=[];
    }
    global_individual_data.push(ind_data);
    
    global.set("global_individual_data",global_individual_data);
    
    
    Node-RED

  • Thanks for node-red-contrib-mysensors and a question regarding collections or arrays
    J Joost

    Ok, with this I can at least create an individual data point object:

    var ind_data={};
    ind_data.nodeid=msg.nodeId;
    ind_data.type=msg.type;
    ind_data.payload=msg.payload;
    
    var global_individual_data=global.get("global_invidual_data");
    if (global_individual_data===undefined) {
        global_individual_data={};
    }
    global_individual_data.push(ind_data);
    

    But "pushing" this on to global_individual_data gives me an error. How could I store those indivudal objects in global context and iterate over them in a template node?

    Node-RED

  • Thanks for node-red-contrib-mysensors and a question regarding collections or arrays
    J Joost

    PS: this here

    var nodekey=msg.nodeId;var datatype=msg.type;var payload=msg.payload;
    //var individual_data={ nodekey, {datatype, payload}};
    var ind_data=[];
    ind_data.push[nodekey][datatype]=payload;
    
    var global_individual_data=global.get("global_invidual_data");
    if (global_individual_data===undefined) {
        global_individual_data={"node":0,"type":"voltage", "payload":3.3333 };
    }
    //global_individual_data.add(individual_data);
    //var nodekey=msg.nodeId;var datatype=msg.type;
    //global_individual_data[nodekey][datatype]=msg.payload;
    
    global.set("global_individual_data",global_individual_data);
    msg.global_individual_data=global_individual_data;
    
    

    is just my last non-working attempt and probably way way off (I know ind_data is not added to global_individual_data in there at this point); I have tried innumerable variations before with no success. I am pretty lost here...

    Debug log right now:

    10/25/2020, 8:52:05 AMnode: Store nodeIDs in arrayfunction : (error)
    "TypeError: Cannot set property 'humi' of undefined"
    10/25/2020, 8:52:05 AMnode: Store nodeIDs in arrayfunction : (error)
    "TypeError: Cannot set property 'pres' of undefined"
    10/25/2020, 8:52:05 AMnode: Store nodeIDs in arrayfunction : (error)
    "TypeError: Cannot set property 'volt' of undefined"
    
    Node-RED

  • Thanks for node-red-contrib-mysensors and a question regarding collections or arrays
    J Joost

    Hi everyone,
    thanks for implementing node-red-contrib-mysensors, which works great and has rejuvenated my interest in MySensors! I find it a lot more accessible compared to others controllers like HomeAssistant, with which I always had problems in implementing my own sensors mainly due to hidden raw data in HomeAss (and others), also problems with persistence (which I did not want) etc etc. Node-Red is very transparent I think, and a great way to receive and process/display MySensor data.

    Now I am looking into getting my dashboard dynamic. I have a couple of MySensors nodes, which are pretty identical (apart from the nodeId), sending 4 childSensorIds of interest to me, based on which I also added a msg.type (temp, humi, pres or voltage). nodeIds are hardcoded in the sketch, so this does not need handling.

    What I would like to do is to show received data without any further ado, when a node is transmitting (meaning in my case when it has battery power).
    A node is transmiting -> data is presented in a table.
    A node is out of power -> entries are removed rsp. not shown in the table, are at least not updated anymore.
    A new node is added to the network -> data is automatically appended to the table.

    Table data might possibly be shown via a template node, see below.

    What I did not get now despite many tries is how to store the received sensor data in an array or collection, to iterate over this in the template node. I guess the strucutre would be to add an entry for every nodeId, and as "subentries" (key:values?) the type and msg.payload. All of this stored in global or flow context to be accessible by the template node.

    Now, anyone might have a hint how to declare the array/collection and how to store and update the sensor data? This is what I did not get to work, see below.

    Thanks everyone for any hints,

    Joost

    [
        {
            "id": "97bf2754.81864",
            "type": "debug",
            "z": "654a29b5.1136",
            "name": "",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "true",
            "targetType": "full",
            "statusVal": "",
            "statusType": "auto",
            "x": 370,
            "y": 380,
            "wires": []
        },
        {
            "id": "10894f66.719a01",
            "type": "ui_template",
            "z": "654a29b5.1136",
            "group": "38e6fc1d.b2f114",
            "name": "",
            "order": 17,
            "width": 0,
            "height": 0,
            "format": "<div ng-bind-html=\"msg.payload\"></div>\n\n<div layout=\"row\" layout-align=\"start center\">\n  <span flex>Node ID</span>\n  <span flex>Temp</span>\n  <span flex>Humi</span>\n  <span flex>Pres</span>\n  <span flex>Voltage</span>\n</div>\n<div layout=\"row\" layout-align=\"start center\" ng-repeat=\"individual_data in msg.global_individual_data\">\n  <span flex style=\"color: green\">{{individual_data.node}}</span>\n  <span flex style=\"color: red\">{{individual_data.node.humi}}</span>\n  <span flex style=\"color: black\">{{individual_data.node.pres}}%</span>\n  <span flex style=\"color: black\">{{individual_data.node.voltage}}</span>\n</div>",
            "storeOutMessages": true,
            "fwdInMessages": true,
            "resendOnRefresh": true,
            "templateScope": "local",
            "x": 380,
            "y": 340,
            "wires": [
                []
            ]
        },
        {
            "id": "b98e0e8c.b686c",
            "type": "function",
            "z": "654a29b5.1136",
            "name": "Store nodeIDs in array",
            "func": "var nodeId_array=global.get(\"nodeId_array\");\nif (nodeId_array===undefined) {\n    nodeId_array=[];\n}\n\nif (! nodeId_array.includes(msg.nodeId)) {\n    nodeId_array.push(msg.nodeId);\n    global.set(\"nodeId_array\", nodeId_array);\n}\nmsg.nodeId_array=nodeId_array;\n\n//key=msg.nodeId+\".\"+msg.type;\n//var individual_data={ \"node\":msg.nodeId, \"type\":msg.type, \"payload\":msg.payload};\nvar nodekey=msg.nodeId;var datatype=msg.type;var payload=msg.payload;\n//var individual_data={ nodekey, {datatype, payload}};\nvar ind_data=[];\nind_data.push[nodekey][datatype]=payload;\n\nvar global_individual_data=global.get(\"global_invidual_data\");\nif (global_individual_data===undefined) {\n    global_individual_data={\"node\":0,\"type\":\"voltage\", \"payload\":3.3333 };\n}\n//global_individual_data.add(individual_data);\n//var nodekey=msg.nodeId;var datatype=msg.type;\n//global_individual_data[nodekey][datatype]=msg.payload;\n\nglobal.set(\"global_individual_data\",global_individual_data);\nmsg.global_individual_data=global_individual_data;\n\n//for (i=0;i<3;i++){\n//message=message+i; //add count to message\n//var newmsg={payload:message,topic:msg.topic}\n//    m_out.push(newmsg);\n//return[m_out];\n\nreturn msg;\n\n//local.count +=1;\n//msg.payload=\"F2 \"+msg.payload+\" \"+local.count;\n//context.set('data',local);\n",
            "outputs": 1,
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "x": 180,
            "y": 340,
            "wires": [
                [
                    "10894f66.719a01",
                    "97bf2754.81864"
                ]
            ]
        },
        {
            "id": "872133a5.70d8a8",
            "type": "function",
            "z": "654a29b5.1136",
            "name": "msg.topic according to childSensorId",
            "func": "switch (msg.childSensorId) {\n    case 0:\n        msg.topic = \"Node \" + msg.nodeId + \" Temp\";\n        msg.type=\"temp\";\n        break;\n    case 1:\n        msg.topic = \"Node \" + msg.nodeId + \" Humi\";\n       msg.type=\"humi\";\n        break;\n    case 2:\n        msg.topic = \"Node \" + msg.nodeId + \" Press\";\n        msg.type=\"pres\";\n        break;\n    case 9:\n        msg.topic = \"Node \" + msg.nodeId + \" Voltage\";\n        msg.type=\"volt\";\n        break;\n}\n\nvar datetimeJC = new Date();\nmsg.timestampJC = datetimeJC.getHours() + \":\" + ('00' + datetimeJC.getMinutes()).slice(-2);\n\nreturn msg;\n",
            "outputs": 1,
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "x": 190,
            "y": 260,
            "wires": [
                [
                    "b359fbb4.3b12f",
                    "b98e0e8c.b686c"
                ]
            ]
        },
        {
            "id": "ce62c592.b3c958",
            "type": "switch",
            "z": "654a29b5.1136",
            "name": "Filter childSensorIds",
            "property": "childSensorId",
            "propertyType": "msg",
            "rules": [
                {
                    "t": "eq",
                    "v": "0",
                    "vt": "str"
                },
                {
                    "t": "eq",
                    "v": "1",
                    "vt": "str"
                },
                {
                    "t": "eq",
                    "v": "2",
                    "vt": "str"
                },
                {
                    "t": "eq",
                    "v": "9",
                    "vt": "str"
                }
            ],
            "checkall": "false",
            "repair": false,
            "outputs": 4,
            "x": 240,
            "y": 140,
            "wires": [
                [
                    "872133a5.70d8a8"
                ],
                [
                    "872133a5.70d8a8"
                ],
                [
                    "872133a5.70d8a8"
                ],
                [
                    "872133a5.70d8a8"
                ]
            ]
        },
        {
            "id": "2434c5bc.48688a",
            "type": "mysdecode",
            "z": "654a29b5.1136",
            "database": "",
            "name": "",
            "mqtt": false,
            "enrich": false,
            "x": 290,
            "y": 40,
            "wires": [
                [
                    "3d2bf478.a96f2c",
                    "ce62c592.b3c958"
                ]
            ]
        },
        {
            "id": "d8a0a27c.b28218",
            "type": "serial in",
            "z": "654a29b5.1136",
            "name": "",
            "serial": "65ccd652.db113",
            "x": 70,
            "y": 40,
            "wires": [
                [
                    "2434c5bc.48688a"
                ]
            ]
        },
        {
            "id": "38e6fc1d.b2f114",
            "type": "ui_group",
            "z": "",
            "name": "Default",
            "tab": "d3c44e8c.f5c748",
            "order": 1,
            "disp": true,
            "width": "8",
            "collapse": true
        },
        {
            "id": "65ccd652.db113",
            "type": "serial-port",
            "z": "",
            "serialport": "/dev/ttyUSB0",
            "serialbaud": "38400",
            "databits": "8",
            "parity": "none",
            "stopbits": "1",
            "waitfor": "",
            "dtr": "none",
            "rts": "none",
            "cts": "none",
            "dsr": "none",
            "newline": "\\n",
            "bin": "false",
            "out": "char",
            "addchar": "",
            "responsetimeout": "10000"
        },
        {
            "id": "d3c44e8c.f5c748",
            "type": "ui_tab",
            "z": "",
            "name": "JC_Dashboard",
            "icon": "dashboard",
            "disabled": false,
            "hidden": false
        }
    ]
    
    Node-RED

  • How do commercial products achieve continuous receive (like in battery powered wireless weather stations)?
    J Joost

    @Puneit-Thukral
    Hi, thanks, checked again, but I did not find any battery operated receiving sensors there; also search did not give any results related to "receive" and other terms alike.
    Mind sharing a link or two?

    General Discussion

  • RFM69/95 won't run
    J Joost

    Is the SX1278 working with the RFM95 driver as well? All my boards are SX1276 and have a different pinout/PCB formfactor...

    Hardware

  • Is soldering castellated pads on THT pads feasible?
    J Joost

    @Joost Added two photos to the project page. KiCAD/rendering still to follow.

    Hardware

  • Is soldering castellated pads on THT pads feasible?
    J Joost

    Hi,

    just a quick feedback on this; I tried it now with two boards and so far it works pretty well. I'll keep using this technique for my minimal nodes for now. Those are by no means "mission critical" in any way, so a possible failure at some point won't pose a major problem.
    I'll probably post a picture on my openhardware.io entry in the coming days.
    Bye, Joost

    Hardware

  • How do commercial products achieve continuous receive (like in battery powered wireless weather stations)?
    J Joost

    Hi everyone,

    I wonder how more or less cheap commercial products like e.g. wireless weather stations (often 433MHz) achieve a continuous wireless connection with both parties battery powered?
    So far this looks impossible to me with RFM95 or NRF24; is the implemented hardware in those products that different? Or are there other tricks I could implement myself in own products (short transceive windows come to mind, probably necessitating some form of synchronization)?

    Bye,

    Joost

    General Discussion

  • Getting Pin Change Interrupts working together with Timer interrupts / sleep(XX ms) on Arduino Pro Mini
    J Joost

    @Yveaux & others:
    So this works great! Here is an example sketch to get Pin Change Interrupts working together with timer-based sleep(). There will be identification of the triggered pin as well as discrimination between rising and falling edge. To test, just add a jumper wire to pin A1 or/and A2 to a Arduino Pro Mini and short it to Ground to wake the Arduino out of a timed sleep() (a connected Radio, here a RFM95, is needed to get the sketch started).

    #include <Arduino.h>
    
    #define MY_RADIO_RFM95
    #include <MySensors.h>
    
    volatile int isrcounter = 0, timercounter=0;
    volatile char PinRegLast, ChangedPin, PinRegister;
    volatile boolean isr_interrupted;
    uint32_t remainingSleepTime = 0;
    
    ISR(PCINT1_vect)
    {
        PinRegister = PINC;
        ChangedPin = PinRegister ^ PinRegLast;
        PinRegLast = PinRegister;
        _wokeUpByInterrupt = 0xFE;
        isr_interrupted=true;
        isrcounter++;
    }
    
    void setup()
    {
    noInterrupts();
    PCICR |= 0b00000011; // Enables Ports B and C Pin Change Interrupts
    PCMSK1 |= 0b00000110; //PCINT9 & PCINT10 = A1 & A2
    PCIFR  = B00000001; // Reset Interruptflag
    pinMode(A1, INPUT_PULLUP); pinMode(A2, INPUT_PULLUP);
    PinRegister = PINC;
    interrupts();
    Serial.begin(38400);
    }
    
    void presentation() {}
    
    void loop()
    {
      noInterrupts();
      if ( isr_interrupted ) {
        isr_interrupted = false;
        switch (ChangedPin){
        case (1 << PINC1):
          if (~PinRegister & (1 << PINC1)) { 
            Serial.print("Interrupted / Woken up by Pin A1, remaining sleep() time: ");  
            remainingSleepTime = getSleepRemaining();
            Serial.println( remainingSleepTime );}
          else { 
            Serial.println("Falling edge of Pin A1"); 
           } 
          break;
        case (1 << PINC2):
          if (~PinRegister & (1 << PINC2)) { 
            Serial.print("Interrupted / Woken up by Pin A2, remaining sleep() time: "); 
            remainingSleepTime = getSleepRemaining();
            Serial.println( remainingSleepTime );}
          else { 
            Serial.println("Falling edge of Pin A2"); 
           }
          break;
        default:
          break;
        interrupts();
        }
      }
      else  { 
        interrupts();
        Serial.println("Timer wake up / Loop"); 
        timercounter++; 
        }
    
      Serial.print("  ");  Serial.print(" ISR Counter: ");Serial.print(isrcounter);  Serial.print("   Timer counter: "); Serial.println(timercounter);
      sleep((uint32_t) 60*1000);
    }
    

    Thanks a lot! Joost

    Troubleshooting

  • Getting Pin Change Interrupts working together with Timer interrupts / sleep(XX ms) on Arduino Pro Mini
    J Joost

    @Yveaux said in Getting Pin Change Interrupts working together with Timer interrupts / sleep(XX ms) on Arduino Pro Mini:

    @Joost as documented it can be roughly 8 seconds off on avr. When an avr is set to sleep for 8 seconds (the maximum watchdog sleep time) and it is woken by an interrupt, it will not know how much time is remaining and always return the same time remaining.
    Try sleeping for a minute, then interrupt after 1 second and after half a minute. The remaining time should be different.

    @Yveaux Hi, yeah, I was already expecting the 8s inaccuracy (which is no problem at all, I am planning to cover intervals of several hours).
    I tried yesterday night with sleep times of 1-5 minutes and could not get it to work at that point (always receiving identical numbers though the time to awakening the node with PCInt differed), but this might be because I just hacked it in an otherwise more complicated sketch.

    I'll start now with making up a minimal test sketch to get the hang of it!
    Thanks, J

    Troubleshooting

  • Getting Pin Change Interrupts working together with Timer interrupts / sleep(XX ms) on Arduino Pro Mini
    J Joost

    @Yveaux Thanks, very cool and promising, will take a more in depth look tomorrow!
    I just threw that in my code quickly tonight, so far I got a 5 digit number back, but that was always the same also with different wake up delays via PCInt after going to sleep().

    Troubleshooting

  • Getting Pin Change Interrupts working together with Timer interrupts / sleep(XX ms) on Arduino Pro Mini
    J Joost

    @zboblamont Thanks, will think about that if a pure software approach fails! Though I'd really like to keep complexity down; I'm planning on fabricating at least 10-20 nodes of that kind (by hand).

    Troubleshooting
  • Login

  • Don't have an account? Register

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