Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. alowhum
    3. Topics
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by alowhum

    • alowhum

      MySensors in a NERF gun - a question about capacitors
      Troubleshooting • • alowhum  

      9
      2
      Votes
      9
      Posts
      42
      Views

      alowhum

      I thought I'd give an update. I added four .470 capacitors in paralel, but the gun was still turning itself off. Then I added the diode, and.. it worked! The gun remains stable. ...at least.. while it was on a beefy lab power supply. It indicates that when firing the gun uses about .6 amps, and it prefers to be around 8.5 volts (6 AA batteries). 9 volts seems to be too much. I tried to switch it to the intended portable design, with a USB PD decoy feeding into a 4A up-down adjustable buck converter. But then it crashes again. For example, I tried this: 55W steam deck USB-C PD power supply -> adjustable decoy set to 15 or 20 volt. down-converting that to 8.5v with the buck converter. Maybe all this power converting means that it can't provide the sudden increases in power when the motor spins up? Perhaps using a linear DC-DC converter work better? Or maybe the USB-PD decoy just can't handle it? It's a mystery.
    • alowhum

      Strange jumps in MH-Z18B CO2 sensor values
      Troubleshooting • • alowhum  

      1
      0
      Votes
      1
      Posts
      9
      Views

      No one has replied

    • alowhum

      MySensors over Bluetooth ?
      General Discussion • • alowhum  

      4
      0
      Votes
      4
      Posts
      49
      Views

      scalz

      no. bluetooth is not secured by default. you need to handle this in your ble fw
    • alowhum

      PineTab as a MySensors smart home controller?
      General Discussion • • alowhum  

      1
      0
      Votes
      1
      Posts
      10
      Views

      No one has replied

    • alowhum

      X27 stepper motor that can be controlled from the Arduino directly
      My Project • • alowhum  

      1
      0
      Votes
      1
      Posts
      22
      Views

      No one has replied

    • alowhum

      Receiver that creates details about data transmission errors
      General Discussion • • alowhum  

      1
      0
      Votes
      1
      Posts
      21
      Views

      No one has replied

    • alowhum

      !MCO:PRO:RC=1 in debug logs
      Troubleshooting • • alowhum  

      5
      0
      Votes
      5
      Posts
      36
      Views

      tekka

      Updated log parser to include RC debug messages: https://github.com/mysensors/MySensors/pull/1396
    • alowhum

      Expanding the size of an existing array?
      Development • • alowhum  

      14
      0
      Votes
      14
      Posts
      96
      Views

      electrik

      I think - am not sure - because you only include mysensors.h, which is only a header file without cpp files.
    • alowhum

      Candle won a Dutch National Privacy Award
      Mozilla WebThings Gateway • • alowhum  

      3
      7
      Votes
      3
      Posts
      29
      Views

      skywatch

      @alowhum Brilliant stuff! - It's great when hard work is recognised and I hope to get cracking with some of your ideas as soon as time allows. Well Done!
    • alowhum

      The wait function does not trigger the watchdog?
      General Discussion • • alowhum  

      2
      0
      Votes
      2
      Posts
      162
      Views

      mfalkvidd

      @alowhum most of these questions are way too advanced for me to answer, but I know that wait() calls _process() which processes messages and kicks the watchdog (through doYield()). See https://github.com/mysensors/MySensors/blob/development/core/MySensorsCore.cpp#L565 while (hwMillis() - enteringMS < waitingMS) { _process(); } By default, nrf24-based nodes do not use interrupts for message handling. There is nothing done in parallell.
    • alowhum

      idea: allow the present function to indicate if an echo will be sent
      Feature Requests • • alowhum  

      5
      0
      Votes
      5
      Posts
      194
      Views

      alowhum

      @mfalkvidd said in idea: allow the present function to indicate if an echo will be sent: To my knowledge, the MySensors library itself will send an echo when requested. There is no need to present if the node supports echo or not, echo is always enabled. Very interesting!
    • alowhum

      Build retry funtionality into the mysensors library
      Feature Requests • • alowhum  

      26
      0
      Votes
      26
      Posts
      731
      Views

      efix durov

      I am not sure how retrying even more times will help anything
    • alowhum

      Looking for very simple rocker switch
      Hardware • • alowhum  

      10
      0
      Votes
      10
      Posts
      545
      Views

      alowhum

      @Nca78 said in Looking for very simple rocker switch: So huge that the pins are in fact way too big (0.8*1.2mm section) to fit on a breadboard or in a Dupont connector Hahaha, that's hilarious Thanks for trying though, really appreciate it!
    • alowhum

      Candle - the privacy friendly smart home
      My Project • • alowhum  

      14
      7
      Votes
      14
      Posts
      5316
      Views

      Nca78

      @alowhum are you still around ?
    • alowhum

      Voco - Voice control for your MySensors network
      Mozilla WebThings Gateway • • alowhum  

      8
      3
      Votes
      8
      Posts
      699
      Views

      alowhum

      According to that link you already solved it, and it was caused by the external access option. Nice work.
    • alowhum

      Easiest way to enable/disable MySensors on running node?
      Development • • alowhum  

      10
      0
      Votes
      10
      Posts
      914
      Views

      FlyingDomotic

      @alowhum: Perhaps something like boolean sendWithPermission(MyMessage &msg) { // Check permission and send here if (connecting_allowed){ send(msg); } }```
    • alowhum

      Candle Manager, a new add-on for the Mozilla WebThings Gateway
      Mozilla WebThings Gateway • • alowhum  

      3
      0
      Votes
      3
      Posts
      536
      Views

      alowhum

      @rmalbers Currently it's focus is the Arduino Nano, but technically it also supports the other Atmel ones, like the Arduino Mega. There is a dropdown in settings where you can select which device you're using. Currently it's at version 0.0.6. It's getting quite robust.
    • alowhum

      Using only two digital pins for a button? (no GND, no VCC)
      General Discussion • • alowhum  

      7
      0
      Votes
      7
      Posts
      678
      Views

      alowhum

      @zboblamont It's not very wasteful if you're not using them for anything else anyway. I'd rather use some extra code than extra hardware.
    • alowhum

      Controller page for Mozilla WebThings Gateway
      Mozilla WebThings Gateway • • alowhum  

      3
      1
      Votes
      3
      Posts
      834
      Views

      alowhum

      @hek Will do. Thanks for adding it!
    • alowhum

      NRF24 Radio Recouperation feature
      Feature Requests • • alowhum  

      10
      0
      Votes
      10
      Posts
      1082
      Views

      mfalkvidd

      @alowhum isn't the existing one sufficient?
    • alowhum

      NODE NOT REG - Node not registered?
      Troubleshooting • • alowhum  

      5
      0
      Votes
      5
      Posts
      578
      Views

      bgunnarb

      That is my conclusion as well!
    • alowhum

      Mozilla Webthings MySensors add-on / adapter
      Mozilla WebThings Gateway • • alowhum  

      55
      6
      Votes
      55
      Posts
      5635
      Views

      rmalbers

      @alowhum I see that one of the requirements for this new candle webthing gateway is "Sonoff Zigbee 3.0 USB stick". If I don't use any zigbee 'things', do I still need that for an install to work? I have mysensor things and native webthing things only. I lost remote access a month or so ago to my webthing controller (known issue but doesn't appear to be fixed) so I am thinking about switching to this 'new' candle controller. I use remote monitoring when I am away from the house to make sure the furnaces, etc. are working. Also, can I run my old webthing controller and this new candle webthing controller at the same time on my network while I get it going (probably a dumb question but I don't know)? I have another rasp pi I can install the new one on.
    • alowhum

      Request for new forum
      General Discussion • • alowhum  

      2
      1
      Votes
      2
      Posts
      387
      Views

      mfalkvidd

      @alowhum done
    • alowhum

      RF Nano = Nano + NRF24, for just $3,50 on Aliexpress
      Hardware • • alowhum  

      80
      1
      Votes
      80
      Posts
      13748
      Views

      TheoL

      How ever powering from usb is not very stable. When sending multiple messages with delays my sketch sometimes stalls. Need to test with the suggested 6v power supply though. But most nodes don't need to send multiple messages quickly
    • alowhum

      MY_SECURITY_SIMPLE_PASSWD -> SIGN VERIFY FAIL
      General Discussion • • alowhum  

      3
      0
      Votes
      3
      Posts
      478
      Views

      alowhum

      It doesn't seem to work properly. It seems data is.. garbled? The first node does show up in Domoticz. It got ID #2 (not 1). It has one child, which is of the correct type. But the other 5 don't show up. The second node I tried shows up in Domoticz.. but it's very weird. It gets ID 148, and things like the node name are not there. Similarly, the child also has weird data: ID: 45 Type: Unknown! Name: 4101763563 I'm going to try a shielded radio module. // Update: same issue. It seems, in the log below, that some of the messages don't come across completely? 0;255;3;0;9;1679510 TSF:MSG:FPAR REQ,ID=1 0;255;3;0;9;1679514 TSF:CKU:OK,FCTRL 0;255;3;0;9;1679517 TSF:MSG:GWL OK 0;255;3;0;9;1681281 !TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0 sg=0,ft=0,st=OK:0 <- HERE 0;255;3;0;9;1696642 TSF:MSG:READ,2-2-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1 0;255;3;0;9;1696648 TSF:MS0;255;3;0;9;1698251 !TSF:MSG:SEND,0-0-2-2,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=NACK:1 0;255;3;0;9;1702721 TSF:MSG:READ,2-2-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;1702727 TSF:MSG:BC 0;255;3;0;9;1702730 TSF:MSG:FPAR REQ,ID=2 0;255;3;0;9;1702734 TSF:PNG:SEND,TO=0 0;255;3;0;9;1702737 TSF:CKU:OK 0;255;3;0;9;1702740 TSF:MSG:GWL OK 0;255;3;0;9;1705198 !TSF:MSG:SEND,0-0-2-2,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0 0;255;3;0;9;1716798 TSF:MSG:READ,2-2-255,s=255,c=3,t=7,pt=0,l=0,G:BC 0;255;3;0;9;1716807 TSF:MSG11 TSF:PNG:SEND,TO=0 0;255;3;0;91716817 TSF:MSG:GWL OK ,0-0-2-2,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0 <- HERE 0;255;3;0;9;1724956 <- HERE TSF:MSG:READ,2-2-0,s=255,c=3,t=24,pt=1,l=1,sG:PINGED,ID=2,HP=1 D,0-0-2-2,s=255,c=3,t=25,pt=1,l=0;255;3;0;9;1728997 TSF:MSG:READ,2-2-255,s=255,c=3,t=7,pt=0,l=0,G:BC 0;255;3;0;9;1729006 TSF:MSG10 TSF:PNG:SEND,TO=0 0;255;3;0;91729016 TSF:MSG:GWL OK
    • alowhum

      Easily programmable nrf5
      Hardware • • alowhum  

      10
      0
      Votes
      10
      Posts
      1094
      Views

      alowhum

      Thanks to both
    • alowhum

      Combined electricity, gas and water use sensor
      General Discussion • • alowhum  

      11
      0
      Votes
      11
      Posts
      1271
      Views

      alowhum

      @benhub that's an interesting thought. Wouldn't it be easier to just make the code in the main node flexible instead?
    • alowhum

      idea: depositTime (opposite of requestTime)
      Feature Requests • • alowhum  

      3
      0
      Votes
      3
      Posts
      518
      Views

      rejoe2

      Why don't you just use an existing message type to send the time to the controller? Imo the real challenge would start the moment the GW handles the message over to the controller: has the controller sw the necessary rights to change system time (in my case: no...) how to deal with conflicting info from different sources? Imo, it's already possible for the rare use case there might be left over (but as explained needs some manual configuration). Especially when using a Pi: add a RTC and make some manual updates on that every now and then (if necessary). Just my2ct.
    • alowhum

      Hardware for the ultimate smart home controller
      General Discussion • • alowhum  

      15
      0
      Votes
      15
      Posts
      2383
      Views

      gohan

      I think it is more of a BT gateway to connect some of their BT devices
    • alowhum

      Open Smart serial TFT LCD touch screen - example Arduino code
      Hardware • • alowhum  

      5
      1
      Votes
      5
      Posts
      2806
      Views

      alowhum

      A small note on my experiences so far. I have settled on using this screen for most cases where I wanted to use a bigger screen for output. Creating small UX-es is awesome. What is also great is that I turn the backlight off after a little while, and then a touch turns it back on again. Similarly, using a touch to turn the screen on and off is nice for when you don't want the screen to shine it's light into the room all the time. I have also gotten it to work slightly faster by creating a better way of handling the serial data it sends. I've also learned that you can send longer strings to it all at once. You need to send the length of the string in the command. I haven't implemented this in my own code yet, but I recently learned about it by better reading the documentation. Something more worrying is that two of the six screens have stopped working. The screens turn on, but there is no serial communication. I believe this is caused by how I handled the screens, and creating small shorts on the back of the screen. My recommendation is to add some non-conductive tape to the entire back to avoid this. Make sure your other electronics don't accidentally touch its back. The resistive touch screen works well, but if there was a capacitive version of the screen I would probably switch to that. Finally, the screen can be separated from the PCB below. It's just attached with double sided tape.
    • alowhum

      Touch screen with built in Arduino 328p
      General Discussion • • alowhum  

      1
      1
      Votes
      1
      Posts
      497
      Views

      No one has replied

    • alowhum

      Candle - signal Hub - A universal 433Mhz signal detector and cloner
      My Project • • alowhum  

      29
      6
      Votes
      29
      Posts
      4463
      Views

      alowhum

      Go for it! I don't see why it wouldn't be possible.
    • alowhum

      Set forum search to only look back 2 years?
      General Discussion • • alowhum  

      5
      2
      Votes
      5
      Posts
      623
      Views

      mfalkvidd

      Neither could I. Tried to trace the html elements and javascript but there doesn't seem to be anything that is easily configurable.
    • alowhum

      The opposite of presenting a child?
      Development • • alowhum  

      4
      0
      Votes
      4
      Posts
      572
      Views

      alowhum

      That's an interesting idea, thanks. Perhaps I could also make two children that contain the numeric count of how many devices are operational. Would this be something that could be relevant to build into MySensors?
    • alowhum

      A few random questions (V_tripped vs V_armed)
      Development • • alowhum  

      14
      0
      Votes
      14
      Posts
      1534
      Views

      mfalkvidd

      @alowhum yes it does. Documentation: https://www.mysensors.org/download/sensor_api_20#waiting
    • alowhum

      Candle Manager - user-friendly web-based tool to program Arduino's
      My Project • • alowhum  

      5
      3
      Votes
      5
      Posts
      1414
      Views

      alowhum

      @homer This is how I do it: First download the latest Mozilla WebThings Gateway image and burn that onto an SD card. Their guide will explain how to 'burn' it onto an SD card. Insert it into the pi and boot it up. After a while you will see a new WiFi network for the gateway. Connect to it and follow the steps. You can skip the step to make a subdomain at Mozilla. Once done, open gateway.local in a browser that's on the same wifi network. You should now see the Mozilla Gateway interface. Under settings -> development enable SSH. Open a terminal window and SSH into the device. Google how to do that. For linux/mac it's something like: ssh pi@gateway.local and then enter the default password raspberry. once logged in, you have to install PHP. sudo apt-get install php5-fpm php5 -y Next, copy the Candle Manager from Github onto the Pi. git clone https://github.com/createcandle/Candle-manager.git chmod +x ./Candle-manager/start.sh ./Candle-manager/start.sh Now you should be able to go to gateway.local:8023 to see the Candle Manager. By default it comes with only one demo sketch. In the future you will be able to install a lot more. Arduino Sketches have to be properly formatted and placed in the 'sources' folder to be automatically presented in the Candle Manager interface. Examples of such sketches can be found here. Basically, the variables that you want to be modifiable via the interface have to be placed in a special section. The description at the top of the sketch will also be shown in the interface. For example: /* * * Temperature and more sensor * * This device can measure: * - temperature * - humidity * - airpressure (barometer). * * * * SETTINGS */ // You can enable and disable the settings below by adding or removing double slashes ( // ) in front of a line. #define HAS_DISPLAY // Did you connect a display? //#define FAHRENHEIT // Do you want temperature measurements to be in Fahrenheit? //#define MY_SECURITY_SIMPLE_PASSWD "changeme" // Be aware, the length of the password has an effect on memory use. /* END OF SETTINGS * * * */ // The actual sketch and other variables are placed here.
    • alowhum

      idea: time child
      Feature Requests • • alowhum  

      3
      0
      Votes
      3
      Posts
      609
      Views

      alowhum

      @monte Thanks, I know.
    • alowhum

      Watchdog not watchdogging?
      Development • • alowhum  

      28
      0
      Votes
      28
      Posts
      3195
      Views

      Jan Kadlec

      I've manualy removed the call for watchdog reset from function void doYield(void) and I can see my user watchdog timer working again... This will probably affect some deep sleep and waking processes - that I do not care about in my cases... I used RadioHead library before, which is much more library in sense of composable part and I was very happy with it's long term stability... Now I'm trying MySensors and it's quite unstable comparing to RadioHead... If it had software signing, I'd definitely use RadioHead... Let's see if enabling user WDT will fix the unstabilities...
    • alowhum

      Idea: multiple virtual devices on one Arduino
      Feature Requests • • alowhum  

      1
      0
      Votes
      1
      Posts
      409
      Views

      No one has replied

    • alowhum

      Idea: interface specific children types
      Feature Requests • • alowhum  

      1
      0
      Votes
      1
      Posts
      363
      Views

      No one has replied

    • alowhum

      Idea: an "upkeep" sensor type
      Feature Requests • • alowhum  

      14
      0
      Votes
      14
      Posts
      1914
      Views

      bjacobse

      This can be achievable by using a TLP5110, this device is only consuming (sipping) 35nA. and then the comment from rozpruwacz is very valid, that you need to be careful of battery self discharging The you can use a switch to wakup the MCU when window is opened, and provide a resister value to TPL5110 to startup MCU once per day, to give a heartbeat signal that sensor is alive http://www.ti.com/lit/ds/symlink/tpl5110.pdf
    • alowhum

      Arduino has an official CLI app now
      General Discussion • • alowhum  

      9
      1
      Votes
      9
      Posts
      1593
      Views

      alowhum

      I just got this to work. It's great! I've updated the first post with a longer guide.
    • alowhum

      Can one arduino present multiple devices?
      General Discussion • • alowhum  

      14
      0
      Votes
      14
      Posts
      1790
      Views

      alowhum

      @zboblamont @parachutesj Thanks! Good to hear your perspectives.
    • alowhum

      Does the simple security option work for a serial gateway?
      General Discussion • • alowhum  

      12
      0
      Votes
      12
      Posts
      1640
      Views

      alowhum

      @scalz Thank you for the clarification. Is there a way to enable OTA that would be 'n00b friendly'? Perhaps by attaching a small device that can then itself be programmed via the Nano's USB port?
    • alowhum

      Arduino 32u4 (MEGA) with built in GSM for $18
      Hardware • • alowhum  

      6
      0
      Votes
      6
      Posts
      2118
      Views

      alowhum

      All that is mentioned in my posts above?
    • alowhum

      Arduino 32U4 with built in RFM95 (LORA) on Aliexpress for $18
      Hardware • • alowhum  

      2
      0
      Votes
      2
      Posts
      1298
      Views

      alowhum

      Also quite nice: a normal Arduino (not the mega) with Lora, but with a nice battery system built in. https://www.aliexpress.com/item/LoRa-Radio-Node-v1-0-Based-on-Sx1278-LoRa-433Mhz-2-4G-RFM98-for-Arduino-ATmega328P/32855090628.html Now if only they made an RFM69 version of that..
    • alowhum

      HMI Intelligent TFT screen - control via serial, $4
      Hardware • • alowhum  

      5
      3
      Votes
      5
      Posts
      1294
      Views

      damis

      @alowhum thank for the that info . i bought the wrong kinda screen . i will buy another type and try again
    • alowhum

      BBC Micro:bit and MySensors - a great match!
      Hardware • • alowhum  

      11
      2
      Votes
      11
      Posts
      3917
      Views

      alowhum

      @neverdie @neverdie I never tried to get OTA to work, no. Glad to see you diving in though!
    • alowhum

      A small NRF24L01 chip comparison
      Hardware • • alowhum  

      8
      1
      Votes
      8
      Posts
      2236
      Views

      jhjjacky

      @yveaux Thank you
    • alowhum

      Capacitor RTC Real Time Clock?
      Hardware • • alowhum  

      3
      0
      Votes
      3
      Posts
      991
      Views

      alowhum

      @nca78 I did that search on Aliexpress but only found coin-cell operated ones?
    • alowhum

      The mysterious RFMB12-D 433Mhz tranceiver
      Hardware • • alowhum  

      4
      0
      Votes
      4
      Posts
      1007
      Views

      alowhum

      The RFM69 is definitely better. But I haven't found a commercial version of the RFM69 that can fit in the NRF24 socket (and ideally allow for 5v communication). If the Moteino allows for the RFMB12 to be soldered on.. does that mean MySensors could also in theory communicate via an RFMB12? Or would modifications to the code need to be made? // hmm, that page says the RFM12B is not really developed for moteino anymore.
    • alowhum

      I got a plug-and-play NRF24 shield for the Pi on Aliexpress
      Hardware • • alowhum  

      9
      0
      Votes
      9
      Posts
      3000
      Views

      puskyer

      UPDATE: if at one point you need to use GPIO18 for something other then RF24L01 then you have to delete the spi-cs-extend.dtbo file from the /boot/overlays/ and then reboot.
    • alowhum

      Trying to bitbang i2c oled screen, using SSD1306Ascii library
      Development • • alowhum  

      12
      0
      Votes
      12
      Posts
      2370
      Views

      alowhum

      For anyone finding this: I got that 'smart' LCD screen that can be controlled with serial commands. It's awesome! The screen now displays a bar graph for all 6 moisture sensors (irrigation controller).
    • alowhum

      CDEBYTE's new NRF24 modules are great! (and cheap)
      General Discussion • • alowhum  

      36
      3
      Votes
      36
      Posts
      8343
      Views

      alowhum

      @gohan Exactly, and the project I'm working on is "no soldering and no programming required (unless you want to)". I guess I'll try ordering one of these modules and see if it can handle full power.
    • alowhum

      Using the F macro in the presentation function
      Development • • alowhum  

      6
      0
      Votes
      6
      Posts
      1091
      Views

      mfalkvidd

      @alowhum yes that is correct
    • alowhum

      Saving three bytes of memory with this crazy loop structure..
      General Discussion • • alowhum  

      18
      0
      Votes
      18
      Posts
      2048
      Views

      AffordableTech

      Hi @mfalkvidd, Problem is, when your code can't compile because you are one (or several) bytes short of ram, nothing else matters. As to readability, I assume you know about that rarely used compiler feature called 'comments'? I hear they use zero Arduino RAM and even less ROM memory. . Ok, I'm just being cheeky, so don't flame me, it just seemed a good opportunity for a reminder to everybody. Point being we are all guilty of not using enough comments in our code. You said you are worried about readability and maintainability - it's just like code backups, it's a problem only because we only worry about them 'after' a drive crash, or in the case of comments, two years later when we are trying to remember what the hell this weird code does.. THE REALITY: If we are really worried, we would add liberal comments and do regular backups - otherwise I say we're not really 'that' worried. Cheers, Paul
    • alowhum

      Adding and removing children... on the fly
      General Discussion • • alowhum  

      3
      0
      Votes
      3
      Posts
      878
      Views

      mfalkvidd

      There is no need to change sketch version. That field is for information only. I don't think controllers support removing anything automatically. Maybe if they have an external api. I'm unable to find anything like that in the Domoticz api: http://www.domoticz.com/wiki/Domoticz_API/JSON_URL's But since it is possible to delete stuff from the Domoticz web UI, maybe you can just check what a delete request looks like?
    • alowhum

      Change the password after the Pi Gateway is already compiled?
      Development • • alowhum  

      4
      0
      Votes
      4
      Posts
      564
      Views

      gohan

      You could distribute not compiled and use a script that changes the password and then compiles the gateway
    • alowhum

      Combine ReSpeaker Pi-hat and NRF24 on same Pi?
      Hardware • • alowhum  

      6
      0
      Votes
      6
      Posts
      1528
      Views

      mfalkvidd

      @alowhum use --spi-spidev-device=<DEVICE> to use the other spi. Documentation: https://www.mysensors.org/apidocs/group__RaspberryPiGateway.html
    • alowhum

      How far does the mesh stretch?
      General Discussion • • alowhum  

      9
      0
      Votes
      9
      Posts
      1381
      Views

      alowhum

      @CrankyCoder I heard that in the Netherlands at least there are technically no laws agains placing sensors in trees
    • alowhum

      Cigaret smoke detector
      General Discussion • • alowhum  

      1
      0
      Votes
      1
      Posts
      490
      Views

      No one has replied

    • alowhum

      A kitchen-sink options header
      Development • • alowhum  

      7
      0
      Votes
      7
      Posts
      1079
      Views

      alowhum

      @waspie: done Doe anyone have any idea about the retries? I'd like my nodes to keep trying to reconnect as long as they have power. Another question: I've read different things about #define MY_DISABLE_SIGNAL_REPORT Some recently said this saves memory, but I've found an older post that states it's already disabled by default.
    • alowhum

      MySensors vs Zigbee
      General Discussion • • alowhum  

      11
      0
      Votes
      11
      Posts
      4161
      Views

      tochinet

      @alowhum Zigbee being "a standard" is not an advantage at all. As you put it, it is indeed not true at all. Using "a standard" in the meaning of "a formal definition of one of the piece of your puzzle" is only an advantage when you want to potentially replace that piece by a piece produced by another manufacturer and still get that talking to the rest of the puzzle. You should also consider that there are two kind of standards : "committee" standards, where experts provide a formal document and people pay to adopt that way of doing things, and "de facto" standard, where there are enough users that do things the same way (or buy the same thing) that it guarantees sufficient resiliency. For example, USB is a committee standard (but if you use A, micro, mini etc. you have to adapt), Arduino Uno is a de facto standard (and there as well, you can choose between Uno or micro, etc.), and its success made possible the clones costing a few bucks.
    • alowhum

      Safe heating with MySensors - how I use it as a smart thermostat
      Development • • alowhum  

      1
      2
      Votes
      1
      Posts
      1715
      Views

      No one has replied

    • alowhum

      [SOLVED] TSF:MSG:PVER,0!=2
      Troubleshooting • • alowhum  

      4
      0
      Votes
      4
      Posts
      1056
      Views

      alowhum

      For anyone finding this: today I seemed to have the same issue, with cleared eeprom and with a test network made with two of the great red eByte radio modules. I read elsewhere on the forum it might be a memory issue.
    • alowhum

      NRF5 as a secure radio for nano?
      General Discussion • • alowhum  

      8
      0
      Votes
      8
      Posts
      1540
      Views

      mfalkvidd

      I used a Pro Mini as slave over SoftwareSerial for a project. Maybe you could use that for inspiration and reuse some code. https://forum.mysensors.org/topic/3438/physical-mood-light-color-and-brightness-selector-based-on-lcd-touchscreen-with-demo-video/
    • alowhum

      MySensors Smart Watch
      General Discussion • • alowhum  

      10
      5
      Votes
      10
      Posts
      2303
      Views

      alowhum

      Has anyone bought a PineTime by chance? They are really progressing quickly, with OTA support and everything.
    • alowhum

      Non-encrypted repeater in a secure network?
      Development • • alowhum  

      4
      0
      Votes
      4
      Posts
      798
      Views

      Anticimex

      Signing allow this. Encryption is for everyone. With signing and "weak security" on the GW, you can selectively have nodes that require it. GW will then only require signed messages from the nodes that themsleves require it. Everyone have to have encryption though, or you need to disable encryption.
    • alowhum

      Getting IKEA to use MySensors?
      General Discussion • • alowhum  

      4
      0
      Votes
      4
      Posts
      1078
      Views

      alowhum

      Thanks! I guess I'd love to see a big player create products that are open to tinkering.
    • alowhum

      Sonoff 433 bridge
      Hardware • • alowhum  

      13
      0
      Votes
      13
      Posts
      5466
      Views

      alowhum

      @alexsh1 I've built something you might be interested in: https://forum.mysensors.org/topic/10094/candle-433-hub-a-universal-433mhz-signal-cloner/1
    • alowhum

      GUIDE - NRF5 / NRF51 / NRF52 for beginners
      Development • • alowhum  

      102
      10
      Votes
      102
      Posts
      18118
      Views

      NeverDie

      @ncollins Impressive! Looks as though you even modeled the exact shape of the coincell holder. And you apparently designed the 3D printer snap enclosures as well. Even just the 3D printed enclosure modelling is quite a task all by itself. I hope to one day evolve into doing that too, but for now the Hammond enclosures are going to be my short-term solution. The smallest Hammond is still not as small as what you've managed to produce, but at 36mm wide for an off-the-shelf ABS enclosure, it's too wide by only about 10mm. Still.... one day I want to 3D print an enclosure to be as small as possible.
    • alowhum

      CKU FAIL & MSG GWL FAIL
      Troubleshooting • • alowhum  

      1
      0
      Votes
      1
      Posts
      390
      Views

      No one has replied

    • alowhum

      Geophone - sensing earthquakes and other seismic vibrations
      General Discussion • • alowhum  

      2
      0
      Votes
      2
      Posts
      1011
      Views

      NeverDie

      @alowhum I've heard of geophones being used to detect footsteps outdoors. Cost was around $60/sensor IIRC. http://www.kr4.us/Geophone-SM-24.html?gclid=CjwKCAiAoNTUBRBUEiwAWje2lqjbwf7gdzmiPalzIry4JBhZ-L-kqX6qqSt4UV0atkOPNGlab9Q5ZxoC_H8QAvD_BwE
    • alowhum

      Arduino "STRONG" versions, with a lot of pins
      Hardware • • alowhum  

      1
      1
      Votes
      1
      Posts
      2687
      Views

      No one has replied

    • alowhum

      Gateway and Python are fighting over access to the GPIO?
      Development • • alowhum  

      1
      0
      Votes
      1
      Posts
      378
      Views

      No one has replied

    • alowhum

      NRF24: using both a capacitor AND a regulator?
      Hardware • • alowhum  

      3
      0
      Votes
      3
      Posts
      772
      Views

      gohan

      Usually the cheap regulators only have the regulator on board, so the cap is still a good practice to have it
    • alowhum

      Is ARM the future of MySensors?
      General Discussion • • alowhum  

      31
      0
      Votes
      31
      Posts
      5350
      Views

      Yveaux

      @dakipro see here for a mapping of wifi and nrf24 channels: https://forum.mysensors.org/topic/4721/nrf-frequency-and-channels/5 NRF24 Channels 2..96 overlap with wifi. I personally would stay away from the high nrf24 channels (110+) as I've seen troublesome performance with clones. Channel 100 performs well at my place.
    • alowhum

      Secure gateway with sms receiver: stability?
      Development • • alowhum  

      17
      0
      Votes
      17
      Posts
      2315
      Views

      alowhum

      So I created a gateway with the 800L.. and as predicted it used too much power. I've now put it on a separate node, and seems to work fine.
    • alowhum

      Goodnight - Measuring sleep cycles
      General Discussion • • alowhum  

      10
      0
      Votes
      10
      Posts
      2278
      Views

      gohan

      I tried jawbone and mi band 2 together for some weeks and the results were not similar.... So I'm wondering how can we do it accurately if commercial products give different results already
    • alowhum

      Next generation CO2 sensor
      General Discussion • • alowhum  

      1
      4
      Votes
      1
      Posts
      1302
      Views

      No one has replied

    • alowhum

      MH-Z19 CO2 sensor
      Hardware • • alowhum  

      23
      0
      Votes
      23
      Posts
      21377
      Views

      TRS-80

      @Joseph-Gill said in MH-Z19 CO2 sensor: "simplicity" Welcome to the forums, Joseph. I am glad to see you put "simplicity" in quotes. Personally, I think that the level of difficulty that is portrayed towards new people (i.e., "it's easy!") is a little misleading. It is easy if you have "The Knack" but perhaps not so for everyone. @Joseph-Gill said in MH-Z19 CO2 sensor: How hard would it be I think this depends mostly on an honest evaluation of your own skills. You will need to have at least basic understanding of the technologies involved: radio propagation, electronics, coding, etc... Now, all of this can be learned of course, especially if you have interest, and time... So another part of it is also your expectations. If you need something "right now" then you might be happier to go buy something "off the shelf." OTOH, if you enjoy tinkering, learning, and want to eventually be able to build all different sort of devices exactly to your specifications and needs, then MySensors might be the right thing for you. IMO, I think the best approach is to take this as a hobby, slowly acquiring parts (the least expensive ones take a long time to come from China!) as well as knowledge, and eventually increasing your capabilities over a long period of time. And you will learn (IMO) very valuable skills in the process...
    • alowhum

      STM32?
      General Discussion • • alowhum  

      82
      0
      Votes
      82
      Posts
      34372
      Views

      Dab0G

      My mini board.
    • alowhum

      The examples on the website need love
      General Discussion • • alowhum  

      11
      1
      Votes
      11
      Posts
      2509
      Views

      alowhum

      Im sorry, but you are misrepresenting my position. I started this post to contribute, and point out an area where I wanted to do some good: to help this project live up to its promise of 'ready to use code examples'. I never said I wanted plug-and-play, that was just to offset the narrative that plug-and-play is not a valuable thing. What it's about is creating a gentle slope to get new people involved in the community. Beginners need working code to help them stay interested in the promise of the project. If the hill is too steep, people will stop climbing. Because of survivorship bias you don't see all the people who tried and quit using MySensors. I have contributed to multiple open source projects, including this one, so I know exactly what you mean about the effort. It also means that when I talk about wasted time, I know what I'm talking about. If two of the sensors I try need me to jump through a lot of hoops, and not the fun kind, then that's something we need to fix. I mean, with the WaveShare device the code for the dust sensor would give twice the level of actual dust! And that code has been on the website for half a year! I may have misinterpreted, but it seemed to me that MySensors project understood that the onboarding of new people is vital. The friendly design of the website with the cute drawings, the light-hearted writing, that seemed like a conscious strategy. One I can totally agree with. But if that's the strategy, then the examples need some love. That's all I was trying to say. What doesn't help is to paint things, and me, black-and-white. Pointing out that the examples don't work does not make me someone who is demanding 'plug and play'. And I don't think it's honest to then paint broken examples as a 'feature' to aid learning. I believe I was just trying to point to a valid concern about keeping it fun for new people to get involved. I thought this community understood that value given the light-hearted design choices. So when I post "steer clear of this one for now" at the Dust sensor page, it's not to disrespect you, but to help new people understand that the sensor is currently not ok, while I was trying to fix it. And yes, there is frustration that I've spent $20 on an old sensor that can be bought for $3 now. A lot of people may have had the same feeling these past months. But in all that time nobody left a warning. Sometimes it feels like people are just solving their own problems, and when they've fixed it for themselves, they don't care enough about the people that come after them. That's not an attack on the core developers by the way, that's a statement about us all. Anyway, onwards. I've contacted environmental agencies about which cheap laser-based sensor they recommend, and I've researched them in detail. I believe it may be a good idea to create a new 'default' dust sensor sketch around the PMS7003. I've also updated the temperature sensor code (I've been testing it today). I'll make an account on OpenHardware and post new versions there. Hek tells me those can then be integrated into the website.
    • alowhum

      Next generation temperature sensor for MySensors
      General Discussion • • alowhum  

      9
      0
      Votes
      9
      Posts
      5195
      Views

      alowhum

      I'v created code for this, and have made a pull request for it on github to replace two example sensors: pressure weather station. It could replace humidity and augment temperature too I guess. It's all good. Here's the code: /** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik Ekblad * Version 1.1 - AnonymousZebra * * DESCRIPTION * This is an example of using the Bosch BME280 module, which can measure temperature, humidity and airpressure, * and do so really accurately, while using very little power. A 3.3v and a 5v version is available, make sure to check which one you have. * It communicates over the I2C protocol. * * This script uses the BME280 library by Embedded Adventures. Download it, and place it in your Arduino library folder. * https://github.com/embeddedadventures/BME280 * * Connect your sensor's powerlines, and connect your sensor to the SDA and SCL pins of your board. * On Arduino Nano SDA is pin A4, and SCL is pin A5. * On the Ardunio Mega and Due the SDA in pin 20, and the SCL is pin 21. * On the Arduino Leonardo and Pro Micro 2 the SDA in pin 2, and the SCL is pin 3. * On the STM32 / Maple Mini you can choose: SDA is B7 or B11. * * This script has been written in such a way that it can at the same time function as a repeater-node. * It can also easily be used on battery power. Booth features can be turned on in the code below. * * Finally, you can decide if you want the forecast feature to be turned on. This is a cool feature, * but there is a catch: it also means that you are locked into taking a measurement exactly once a * minute, to build up prediction data for the algorithm. * * The reasons so many variables have BME280 at the beginning, is so that it is easier to combine multiple sensors on one Arduino. * * * The BME280 datasheet: https://cdn.sparkfun.com/assets/learn_tutorials/4/1/9/BST-BME280_DS001-10.pdf * */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 // A 2.4Ghz transmitter and receiver, often used with MySensors. #define MY_RF24_PA_LEVEL RF24_PA_MIN // This sets a low-power mode for the radio. Useful if you use the version with the bigger antenna, but don't want to power that from a separate power source. It can also fix problems with fake Chinese versions of the radio. // #define MY_RADIO_RFM69 // 433Mhz transmitter and reveiver. // Choose if you want this sensor to also be a repeater. // #define MY_REPEATER_FEATURE // Just remove the two slashes at the beginning of this line to also enable this sensor to act as a repeater for other sensors. If this node is on battery power, you probably shouldn't enable this. // Are you using this sensor on battery power? // #define BATTERY_POWERED // Just remove the two slashes at the beginning of this line if your node is battery powered. It will then go into deep sleep as much as possible. While it's sleeping it can't work as a repeater! // Would you like the sensor to generate a weather forecast based on the barometric pressure? #define GENERATE_FORECAST // Just remove the two slashes at the beginning of this line to enable this feature. // LIBRARIES #include <SPI.h> // A communication backbone, the Serial Peripheral Interface. #include <MySensors.h> // The MySensors library. Hurray! #include <Wire.h> // Enables the Wire communication protocol. //#include <Adafruit_BME280.h> // alternative library you could try (DIY; no code for this is in here yet). //#include <SparkFunBME280.h> // alternative library you could try (DIY; no code for this is in here yet). #include <BME280_MOD-1022.h> // Bosch BME280 Embedded Adventures MOD-1022 weather multi-sensor Arduino code, written originally by Embedded Adventures. https://github.com/embeddedadventures/BME280 // VARIABLES YOU CAN CHANGE const float ALTITUDE = 14; // Change this value to your location's altitude (in m). Use your smartphone GPS to get an accurate value, or use an online map. unsigned long BME280measurementInterval = 60000; // Sleep time between reads for the BME sensor (in ms). Keep this value at 60000 if you have enabled the forecast feature, as the forecast algorithm needs a sample every minute. #define COMPARE_TEMP 1 // Send temperature only if it changed? 1 = Yes 0 = No. Can save battery. float tempThreshold = 0.1; // How big a temperature difference has to minimally be before an update is sent. Makes the sensor less precise, but also less jittery, and can save battery. #define COMPARE_HUM 1 // Send temperature only if changed? 1 = Yes 0 = No. Can save battery. float humThreshold = 0.1; // How big a humidity difference has to minimally be before an update is sent. Makes the sensor less precise, but also less jittery, and can save battery. #define COMPARE_BARO 1 // Send temperature only if changed? 1 = Yes 0 = No. Can save battery. float presThreshold = 0.1; // How big a barometric difference has to minimally be before an update is sent. Makes the sensor less precise, but also less jittery, and can save battery. //VARIABLES YOU PROBABLY SHOULDN'T CHANGE #define TEMP_CHILD_ID 0 // for MySensors. Within this node each sensortype should have its own ID number. #define HUM_CHILD_ID 1 #define BARO_CHILD_ID 2 float lastTemperature = -1; float lastHumidity = -1; float lastPressure = -1; unsigned long BME280measurementSleepTime = 0; // variable to store the calculated Sleep time if the node is battery powered. #define CONVERSION_FACTOR (1.0/10.0) // used by forecast algorithm to convert from Pa to kPa, by dividing hPa by 10. #ifdef GENERATE_FORECAST // Below you will find a lot of variables used by the forecast algorithm. const char *weather[] = { "stable", "sunny", "cloudy", "unstable", "thunderstorm", "unknown" }; enum FORECAST { STABLE = 0, // "Stable Weather Pattern" SUNNY = 1, // "Slowly rising Good Weather", "Clear/Sunny " CLOUDY = 2, // "Slowly falling L-Pressure ", "Cloudy/Rain " UNSTABLE = 3, // "Quickly rising H-Press", "Not Stable" THUNDERSTORM = 4, // "Quickly falling L-Press", "Thunderstorm" UNKNOWN = 5 // "Unknown (More Time needed) }; int lastForecast = -1; const int LAST_SAMPLES_COUNT = 5; float lastPressureSamples[LAST_SAMPLES_COUNT]; int minuteCount = 0; bool firstRound = true; // average value is used in forecast algorithm. float pressureAvg; // average after 2 hours is used as reference value for the next iteration. float pressureAvg2; #endif float dP_dt; bool metric = true; // Variable that stores if the sensor will output the temperature in Fahrenheit of Celsius. The gateway sends this preference to the node, so you dont need to change it here. bool receivedConfig = false; // The MySensors gateway will tell the node if it should output in metric or not. MyMessage temperatureMsg(TEMP_CHILD_ID, V_TEMP); MyMessage humidityMsg(HUM_CHILD_ID, V_HUM); MyMessage pressureMsg(BARO_CHILD_ID, V_PRESSURE); #ifdef GENERATE_FORECAST MyMessage forecastMsg(BARO_CHILD_ID, V_FORECAST); #endif void setup() { Wire.begin(); // Wire.begin(sda, scl) // starts the wire communication protocol, used to chat with the BME280 sensor. Serial.begin(115200); // for serial debugging over USB. Serial.println("Hello world, I am a sensor node."); #ifdef BATTERY_POWERED // If the node is battery powered, we'll let Sleep take over the scheduling. BME280measurementSleepTime = BME280measurementInterval; BME280measurementInterval = 0; // When the Arduino is asleep, millis doesn't increment anymore (time stops as it were). To fix this, we'll set the measurement interval time to 1, so that when the arduino wakes up it will immediately try to measure again. #endif } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("BME280 Sensor", "1.1"); // Tell the MySensors gateway what kind of sensors this node has, and what their ID's on the node are, as defined in the code above. present(BARO_CHILD_ID, S_BARO); present(TEMP_CHILD_ID, S_TEMP); present(HUM_CHILD_ID, S_HUM); } void loop() { // You should not change these variables: static unsigned long previousBME280Millis = 0; // Used to remember the time that the BME280 sensor was asked for a measurement. unsigned long currentMillis = millis(); // The time since the sensor started, counted in milliseconds. This script tries to avoid using the Sleep function, so that it could at the same time be a MySensors repeater. static boolean BME280shouldAsk = true; // This is true when the time is right for a new measurement to be made. static boolean BME280justAsked = false; // This indicates whether we have just asked the sensor module for a measurement, so the receiving part of the code (part 2) should be primed. This two-part construction helps to bridge the time where the BME280 module is busy, without blocking the entire node from doing anything else (like being a repeater, or working with other connected sensor modules). // PART 1. If enough time has passed, a new measurement should be taken: if (BME280shouldAsk == true && currentMillis - previousBME280Millis >= BME280measurementInterval) { previousBME280Millis = currentMillis; // store the current time as the previous measurement start time. BME280shouldAsk = false; Serial.println(""); Serial.println("BME280 - Requesting data from sensor."); BME280.readCompensationParams(); // Need to read the NVM compensation parameters. #ifdef BATTERY_POWERED // After taking the measurement the chip goes back to sleep. This code is only enabled if you enabled BATTERY POWERED at the top of this script. // Oversampling settings (os1x, os2x, os4x, os8x or os16x). BME280.writeFilterCoefficient(fc_16); // IIR Filter coefficient, higher numbers avoid sudden changes to be accounted for (such as slamming a door) BME280.writeOversamplingPressure(os16x); // pressure x16 BME280.writeOversamplingTemperature(os8x); // temperature x8 BME280.writeOversamplingHumidity(os8x); // humidity x8 BME280.writeMode(smForced); // Forced sample. After taking the measurement the chip goes back to sleep. #else // Normal mode for regular automatic samples BME280.writeStandbyTime(tsb_0p5ms); // tsb = 0.5ms BME280.writeFilterCoefficient(fc_16); // IIR Filter coefficient 16 BME280.writeOversamplingPressure(os16x); // pressure x16 BME280.writeOversamplingTemperature(os8x); // temperature x8 BME280.writeOversamplingHumidity(os8x); // humidity x8 BME280.writeMode(smNormal); #endif // As we exit part 1, in theory BME280.isMeasuring() should now be true. BME280justAsked = true; } // Part 2. This will trigger if the sensor has just been asked for a measurement, and is also just done figuring out those measurements. if(BME280justAsked == true && BME280.isMeasuring() == false) { // BME280justAsked = false; // makes sure we don't do this part again in the next pass through the main loop. Serial.println("BME280 - Sensor module has some values ready:"); // Read out the data - must do this before calling the getxxxxx routines BME280.readMeasurements(); float temperature = BME280.getTemperatureMostAccurate(); // must get temp first float humidity = BME280.getHumidityMostAccurate(); float pressure_local = BME280.getPressureMostAccurate(); // Get pressure at current location float pressure = pressure_local/pow((1.0 - ( ALTITUDE / 44330.0 )), 5.255); // Adjust to sea level pressure using user altitude #ifdef GENERATE_FORECAST int forecast = sample(pressure); #endif if (!metric) { // Convert temperature to fahrenheit temperature = temperature * 9.0 / 5.0 + 32.0; } // Useful for debugging Serial.print("BME280 - Temperature = "); Serial.print(temperature); Serial.println(metric ? " °C" : " °F"); Serial.print("BME280 - Humidity = "); Serial.print(humidity); Serial.println(" %"); Serial.print("BME280 - Pressure = "); Serial.print(pressure); Serial.println(" hPa"); #ifdef GENERATE_FORECAST Serial.print("BME280 - Forecast = "); Serial.println(weather[forecast]); #endif // Now, let's send the measurements to the gateway. // Send temperature if(temperature != -127.00 && temperature != 85.00) { // Avoids working with measurement errors. if (COMPARE_TEMP == 1 && abs(temperature - lastTemperature) < tempThreshold) { // is the temperature difference bigger than the threshold? Serial.print(temperature - lastTemperature); Serial.print("- BME280 - Temperature difference too small, so not sending the new measurement to the gateway.\n"); } else { Serial.print("BME280 - Sending the new temperature to the gateway.\n"); send(temperatureMsg.set(temperature, 1)); lastTemperature = temperature; // Save new temperatures to be able to compare in the next round. } } // Send humidity if (COMPARE_TEMP == 1 && abs(humidity - lastHumidity) < humThreshold) { // is the humidity difference bigger than the threshold? Serial.print(humidity - lastHumidity); Serial.println("- BME280 - Humidity difference too small, so not sending the new measurement to the gateway."); } else { Serial.println("BME280 - Sending the new humidity to the gateway."); send(humidityMsg.set(humidity, 1)); lastHumidity = humidity; // Save new humidity to be able to compare in the next round. } // Send pressure if (COMPARE_TEMP == 1 && abs(pressure - lastPressure) < presThreshold) { // is the pressure difference bigger than the threshold? Serial.print(pressure - lastPressure); Serial.println("- BME280 - Pressure difference too small, so not sending the new measurement to the gateway."); } else { Serial.println("BME280 - Sending the new pressure to the gateway."); send(pressureMsg.set(pressure, 1)); lastPressure = pressure; // Save new pressure to be able to compare in the next round. } #ifdef GENERATE_FORECAST // Send forecast if (forecast != lastForecast) { Serial.println("BME280 - Sending the latest forecast to the gateway."); send(forecastMsg.set(weather[forecast])); lastForecast = forecast; } #endif Serial.println("BME280 - Measurement complete. Going to wait until next measurement."); BME280shouldAsk = true; // Ready for the new round. } #ifdef BATTERY_POWERED // This code will only be included in the sketch if the BATTERY POWERED feature is enabled. if(BME280shouldAsk == true && BME280justAsked == false) { // Both parts are done, so we can let the sensor sleep again. unsigned long quicktimecheck = millis(); // To check how much time has passed since the beginning of being awake, and then calculate from that how long to sleep until the next intended measuring time, we need to know how many milliseconds have passed. unsigned long sleeptime = BME280measurementSleepTime - (quicktimecheck - previousBME280Millis); // How much time has passed already during the calculating? Subtract that from the intended interval time. Serial.println("BME280 - zzzzZZZZzzzzZZZZzzzz"); sleep (sleeptime); Serial.println("BME280 - Waking up."); } #endif } // end of main loop. #ifdef GENERATE_FORECAST // These functions are only included if the forecast function is enables. The are used to generate a weater prediction by checking if the barometric pressure is rising or falling over time. float getLastPressureSamplesAverage() { float lastPressureSamplesAverage = 0; for (int i = 0; i < LAST_SAMPLES_COUNT; i++) { lastPressureSamplesAverage += lastPressureSamples[i]; } lastPressureSamplesAverage /= LAST_SAMPLES_COUNT; return lastPressureSamplesAverage; } // Forecast algorithm found here // http://www.freescale.com/files/sensors/doc/app_note/AN3914.pdf // Pressure in hPa --> forecast done by calculating kPa/h int sample(float pressure) { // Calculate the average of the last n minutes. int index = minuteCount % LAST_SAMPLES_COUNT; lastPressureSamples[index] = pressure; minuteCount++; if (minuteCount > 185) { minuteCount = 6; } if (minuteCount == 5) { pressureAvg = getLastPressureSamplesAverage(); } else if (minuteCount == 35) { float lastPressureAvg = getLastPressureSamplesAverage(); float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR; if (firstRound) { // first time initial 3 hour dP_dt = change * 2; // note this is for t = 0.5hour } else { dP_dt = change / 1.5; // divide by 1.5 as this is the difference in time from 0 value. } } else if (minuteCount == 65) { float lastPressureAvg = getLastPressureSamplesAverage(); float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR; if (firstRound) { //first time initial 3 hour dP_dt = change; //note this is for t = 1 hour } else { dP_dt = change / 2; //divide by 2 as this is the difference in time from 0 value } } else if (minuteCount == 95) { float lastPressureAvg = getLastPressureSamplesAverage(); float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR; if (firstRound) { // first time initial 3 hour dP_dt = change / 1.5; // note this is for t = 1.5 hour } else { dP_dt = change / 2.5; // divide by 2.5 as this is the difference in time from 0 value } } else if (minuteCount == 125) { float lastPressureAvg = getLastPressureSamplesAverage(); pressureAvg2 = lastPressureAvg; // store for later use. float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR; if (firstRound) { // first time initial 3 hour dP_dt = change / 2; // note this is for t = 2 hour } else { dP_dt = change / 3; // divide by 3 as this is the difference in time from 0 value } } else if (minuteCount == 155) { float lastPressureAvg = getLastPressureSamplesAverage(); float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR; if (firstRound) { // first time initial 3 hour dP_dt = change / 2.5; // note this is for t = 2.5 hour } else { dP_dt = change / 3.5; // divide by 3.5 as this is the difference in time from 0 value } } else if (minuteCount == 185) { float lastPressureAvg = getLastPressureSamplesAverage(); float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR; if (firstRound) { // first time initial 3 hour dP_dt = change / 3; // note this is for t = 3 hour } else { dP_dt = change / 4; // divide by 4 as this is the difference in time from 0 value } pressureAvg = pressureAvg2; // Equating the pressure at 0 to the pressure at 2 hour after 3 hours have past. firstRound = false; // flag to let you know that this is on the past 3 hour mark. Initialized to 0 outside main loop. } int forecast = UNKNOWN; if (minuteCount < 35 && firstRound) { //if time is less than 35 min on the first 3 hour interval. forecast = UNKNOWN; } else if (dP_dt < (-0.25)) { forecast = THUNDERSTORM; } else if (dP_dt > 0.25) { forecast = UNSTABLE; } else if ((dP_dt > (-0.25)) && (dP_dt < (-0.05))) { forecast = CLOUDY; } else if ((dP_dt > 0.05) && (dP_dt < 0.25)) { forecast = SUNNY; } else if ((dP_dt >(-0.05)) && (dP_dt < 0.05)) { forecast = STABLE; } else { forecast = UNKNOWN; } // uncomment when debugging //Serial.print(F("BME280 - Forecast at minute ")); //Serial.print(minuteCount); //Serial.print(F(" dP/dt = ")); //Serial.print(dP_dt); //Serial.print(F("kPa/h --> ")); //Serial.println(weather[forecast]); return forecast; } #endif
    • alowhum

      Next generation dust sensor for MySensors
      General Discussion • • alowhum  

      30
      0
      Votes
      30
      Posts
      25147
      Views

      mfalkvidd

      https://www.bosch-sensortec.com/products/environmental-sensors/particulate-matter-sensor/bmv080/ could be the next generation. No moving parts. Measures PM2.5. Datasheet: https://www.bosch-sensortec.com/media/boschsensortec/downloads/product_flyer/bst-bmv080-fl000.pdf
    • alowhum

      Simplifying MySensors security: the third option.
      Development • • alowhum  

      19
      0
      Votes
      19
      Posts
      3526
      Views

      Anticimex

      @alowhum whenever you like. Code logic should be done. Whitelisting is also supported. Doxygen docs need more work. Thanks!
    • alowhum

      New non-blocking temperature sensor code
      Development • • alowhum  

      13
      4
      Votes
      13
      Posts
      6024
      Views

      alowhum

      I've also created some code for use with the much nicer BME280 sensor. It's on the github, under MySensors examples, as a pull request. Hopefully it will become a part of those examples.
    • alowhum

      The dust sensor is now finally working
      Development • • alowhum  

      14
      1
      Votes
      14
      Posts
      6077
      Views

      alexsh1

      @NeverDie Please see this thread re pollen count: https://forum.mysensors.org/topic/3603/pollen-sensor-for-hay-fever-alert/6 I did not realise, but it has been two years now since I looked into this....