Navigation

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

    patrikr76

    @patrikr76

    1
    Reputation
    8
    Posts
    265
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    patrikr76 Follow

    Best posts made by patrikr76

    • RE: πŸ’¬ Power Meter Pulse Sensor

      @mfalkvidd , you are absolutely right. Let me clarify.
      I am using the example code that is under build and power meter pulse sensor, updated may 1st, 2018.
      Running it with "sleep mode = false" it works fine with both usb and battery power, just drains the battery quite fast.
      Setting it to "sleep mode = true" it doesn't work either on usb or battery power.

      Here's how the serial monitor looks for the startup phase with sleep mode as true.

      23:21:24.219 ->  __  __       ____
      23:21:24.219 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
      23:21:24.219 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
      23:21:24.219 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
      23:21:24.219 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
      23:21:24.219 ->         |___/                      2.3.0
      23:21:24.219 -> 
      23:21:24.219 -> 16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0
      23:21:24.254 -> 25 TSM:INIT
      23:21:24.254 -> 26 TSF:WUR:MS=0
      23:21:24.254 -> 33 TSM:INIT:TSP OK
      23:21:24.254 -> 35 TSF:SID:OK,ID=2
      23:21:24.254 -> 37 TSM:FPAR
      73 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      201 TSF:MSG:READ,0-0-2,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      23:21:24.428 -> 205 TSF:MSG:FPAR OK,ID=0,D=1
      2080 TSM:FPAR:OK
      23:21:26.306 -> 2081 TSM:ID
      23:21:26.306 -> 2082 TSM:ID:OK
      23:21:26.306 -> 2084 TSM:UPL
      23:21:26.306 -> 2087 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      23:21:26.306 -> 2095 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      23:21:26.306 -> 2100 TSF:MSG:PONG RECV,HP=1
      23:21:26.306 -> 2103 TSM:UPL:OK
      23:21:26.306 -> 2104 TSM:READY:ID=2,PAR=0,DIS=1
      23:21:26.306 -> 2109 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      23:21:26.341 -> 2118 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      23:21:26.341 -> 2125 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.0
      23:21:26.341 -> 2134 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      2203 TSF:MSG:READ,0-0-2,s=255,c=3,t=6,pt=0,l=1,sg=0:M
      23:21:26.410 -> 2210 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=11,pt=0,l=12,sg=0,ft=0,st=OK:Energy Meter
      23:21:26.445 -> 2220 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
      23:21:26.445 -> 2228 TSF:MSG:SEND,2-2-0-0,s=1,c=0,t=13,pt=0,l=0,sg=0,ft=0,st=OK:
      23:21:26.445 -> 2234 MCO:REG:REQ
      23:21:26.445 -> 2237 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      2252 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      23:21:26.480 -> 2257 MCO:PIM:NODE REG=1
      23:21:26.480 -> 2259 MCO:BGN:STP
      23:21:26.480 -> 2263 TSF:MSG:SEND,2-2-0-0,s=1,c=2,t=24,pt=0,l=0,sg=0,ft=0,st=OK:
      23:21:26.480 -> 2269 MCO:BGN:INIT OK,TSP=1
      23:21:26.480 -> 2272 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:21:26.480 -> 2277 TSF:TDI:TSL
      

      As far as i can see it seems fine and also shows up in myscontroller.

      And here is an example how it looks after 20 seconds sleep.

      2414 MCO:SLP:WUP=-1
      23:26:36.346 -> 2416 TSF:TRI:TSB
      23:26:36.346 -> 2418 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:26:36.346 -> 2423 TSF:TDI:TSL
      

      I don't see any connection attempts with my gateway, or shouldn't there by any if the sensor is not triggered?

      Here i can show how it looks when tricking the sensor with the ir on the mouse.

      2456 MCO:SLP:WUP=-1
      23:27:48.785 -> 2458 TSF:TRI:TSB
      23:27:48.785 -> 2460 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:48.785 -> 2465 TSF:TDI:TSL
      2467 MCO:SLP:WUP=-1
      23:27:48.924 -> 2468 TSF:TRI:TSB
      23:27:48.959 -> 2470 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:48.959 -> 2476 TSF:TDI:TSL
      2478 MCO:SLP:WUP=-1
      23:27:49.098 -> 2480 TSF:TRI:TSB
      23:27:49.098 -> 2481 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:49.098 -> 2486 TSF:TDI:TSL
      2488 MCO:SLP:WUP=-1
      23:27:49.235 -> 2490 TSF:TRI:TSB
      23:27:49.235 -> 2492 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:49.270 -> 2497 TSF:TDI:TSL
      2498 MCO:SLP:WUP=-1
      23:27:49.408 -> 2500 TSF:TRI:TSB
      23:27:49.408 -> 2502 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:49.408 -> 2507 TSF:TDI:TSL
      2509 MCO:SLP:WUP=-1
      23:27:49.546 -> 2510 TSF:TRI:TSB
      23:27:49.546 -> 2512 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:49.546 -> 2518 TSF:TDI:TSL
      

      Interrupt is triggered and it wakes up, but nothing is sent to the gateway.

      Have i missed something?

      posted in Announcements
      patrikr76
      patrikr76

    Latest posts made by patrikr76

    • RE: πŸ’¬ Building a Raspberry Pi Gateway

      @mfalkvidd said in πŸ’¬ Building a Raspberry Pi Gateway:

      @patrikr76 I beleive @phildefer pushed the code 4 days ago. See https://github.com/mysensors/MySensors/pull/1353

      You are correct.
      @phildefer, thank you.
      There were a couple of minor warnings about indentations and the buffer size i mentioned earlier fixed by upping the declared buffer in GPIO.cpp. Not sure if that is a good fix or not, the warning goes away though.
      A few other warnings looks like this:

      In member function β€˜char* MyMessage::getString(char*) const’,
          inlined from β€˜bool transportSendWrite(uint8_t, MyMessage&)’ at ./core/MyTransport.cpp:987:2,
          inlined from β€˜bool transportRouteMessage(MyMessage&)’ at ./core/MyTransport.cpp:560:40,
          inlined from β€˜void stUplinkTransition()’ at ./core/MyTransport.cpp:252:29:
      ./core/MyMessage.cpp:284:17: warning: β€˜char* strncpy(char*, const char*, size_t)’ output may be truncated copying between 0 and 25 bytes from a string of length 25 [-Wstringop-truncation]
          (void)strncpy(buffer, this->data, this->getLength());
                ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      

      Not sure how to fix those.

      Edit: Forgot to mention, it seems to be working though.

      posted in Announcements
      patrikr76
      patrikr76
    • RE: πŸ’¬ Building a Raspberry Pi Gateway

      Hey all,

      I got the same problem as @swedchef and saw the warnings @alowhum mentioned.
      Simply upping the buffer that is declared in GPIO.cpp solved the warnings and made it compile without issue but the radio still won't work.
      Maybe it has to do with the soc not being detected, as mentioned, and that the pin positions on the new soc are different from previous ones.

      @phildefer, weekend has come and gone buddy. Patience is a virtue some do not have. πŸ™‚

      Edit: So looking a little more through the files today i see that configure looks for the soc type in /proc/cpuinfo and funnily my raspi 4 reports a BCM2835

      posted in Announcements
      patrikr76
      patrikr76
    • RE: πŸ’¬ Power Meter Pulse Sensor

      Found a solution, which is not ideal.
      I was having similar problem with a motion sensor not being able to send, adding a delay after sleep helped on that one, but it was just a 5ms delay needed.

      On this one i had to add a 1 sec delay in the begining of the loop. I tried smaller but then it didn't work.
      I am starting to think it is the nano clone that has crappy components.

      posted in Announcements
      patrikr76
      patrikr76
    • RE: πŸ’¬ Power Meter Pulse Sensor

      @mfalkvidd , Here's the serial monitor after adding the serial print.

      2269 MCO:SLP:WUP=-1
      14:15:15.125 -> 2270 TSF:TRI:TSB
      14:15:15.125 -> 0
      14:15:15.125 -> 2272 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      14:15:15.125 -> 2277 TSF:TDI:TSL
      2279 MCO:SLP:WUP=-1
      14:15:37.264 -> 2281 TSF:TRI:TSB
      14:15:37.264 -> 0
      14:15:37.264 -> 2282 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      14:15:37.264 -> 2287 TSF:TDI:TSL
      2289 MCO:SLP:WUP=-1
      14:15:59.354 -> 2291 TSF:TRI:TSB
      14:15:59.354 -> 0
      14:15:59.354 -> 2293 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      14:15:59.389 -> 2298 TSF:TDI:TSL
      

      As you see, it sleeps about 22 secs with no pulse on it.

      Moving the mouse over it gives this.

      2353 MCO:SLP:WUP=-1
      14:18:09.982 -> 2355 TSF:TRI:TSB
      14:18:09.982 -> 4
      14:18:09.982 -> 2357 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      14:18:09.982 -> 2362 TSF:TDI:TSL
      2363 MCO:SLP:WUP=-1
      14:18:23.059 -> 2365 TSF:TRI:TSB
      14:18:23.059 -> 5
      14:18:23.059 -> 2367 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      14:18:23.059 -> 2372 TSF:TDI:TSL
      

      Looking through the code, this one raises a flag.

      if (pcReceived && (SLEEP_MODE || sendTime))
      

      The pulseCount send is within that if statement which is not fullfilled because it doesn't receive pcReceived.
      Or am i wrong?

      posted in Announcements
      patrikr76
      patrikr76
    • RE: πŸ’¬ Power Meter Pulse Sensor

      @mfalkvidd , you are absolutely right. Let me clarify.
      I am using the example code that is under build and power meter pulse sensor, updated may 1st, 2018.
      Running it with "sleep mode = false" it works fine with both usb and battery power, just drains the battery quite fast.
      Setting it to "sleep mode = true" it doesn't work either on usb or battery power.

      Here's how the serial monitor looks for the startup phase with sleep mode as true.

      23:21:24.219 ->  __  __       ____
      23:21:24.219 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
      23:21:24.219 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
      23:21:24.219 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
      23:21:24.219 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
      23:21:24.219 ->         |___/                      2.3.0
      23:21:24.219 -> 
      23:21:24.219 -> 16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0
      23:21:24.254 -> 25 TSM:INIT
      23:21:24.254 -> 26 TSF:WUR:MS=0
      23:21:24.254 -> 33 TSM:INIT:TSP OK
      23:21:24.254 -> 35 TSF:SID:OK,ID=2
      23:21:24.254 -> 37 TSM:FPAR
      73 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      201 TSF:MSG:READ,0-0-2,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      23:21:24.428 -> 205 TSF:MSG:FPAR OK,ID=0,D=1
      2080 TSM:FPAR:OK
      23:21:26.306 -> 2081 TSM:ID
      23:21:26.306 -> 2082 TSM:ID:OK
      23:21:26.306 -> 2084 TSM:UPL
      23:21:26.306 -> 2087 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      23:21:26.306 -> 2095 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      23:21:26.306 -> 2100 TSF:MSG:PONG RECV,HP=1
      23:21:26.306 -> 2103 TSM:UPL:OK
      23:21:26.306 -> 2104 TSM:READY:ID=2,PAR=0,DIS=1
      23:21:26.306 -> 2109 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      23:21:26.341 -> 2118 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      23:21:26.341 -> 2125 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.0
      23:21:26.341 -> 2134 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      2203 TSF:MSG:READ,0-0-2,s=255,c=3,t=6,pt=0,l=1,sg=0:M
      23:21:26.410 -> 2210 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=11,pt=0,l=12,sg=0,ft=0,st=OK:Energy Meter
      23:21:26.445 -> 2220 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
      23:21:26.445 -> 2228 TSF:MSG:SEND,2-2-0-0,s=1,c=0,t=13,pt=0,l=0,sg=0,ft=0,st=OK:
      23:21:26.445 -> 2234 MCO:REG:REQ
      23:21:26.445 -> 2237 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      2252 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      23:21:26.480 -> 2257 MCO:PIM:NODE REG=1
      23:21:26.480 -> 2259 MCO:BGN:STP
      23:21:26.480 -> 2263 TSF:MSG:SEND,2-2-0-0,s=1,c=2,t=24,pt=0,l=0,sg=0,ft=0,st=OK:
      23:21:26.480 -> 2269 MCO:BGN:INIT OK,TSP=1
      23:21:26.480 -> 2272 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:21:26.480 -> 2277 TSF:TDI:TSL
      

      As far as i can see it seems fine and also shows up in myscontroller.

      And here is an example how it looks after 20 seconds sleep.

      2414 MCO:SLP:WUP=-1
      23:26:36.346 -> 2416 TSF:TRI:TSB
      23:26:36.346 -> 2418 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:26:36.346 -> 2423 TSF:TDI:TSL
      

      I don't see any connection attempts with my gateway, or shouldn't there by any if the sensor is not triggered?

      Here i can show how it looks when tricking the sensor with the ir on the mouse.

      2456 MCO:SLP:WUP=-1
      23:27:48.785 -> 2458 TSF:TRI:TSB
      23:27:48.785 -> 2460 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:48.785 -> 2465 TSF:TDI:TSL
      2467 MCO:SLP:WUP=-1
      23:27:48.924 -> 2468 TSF:TRI:TSB
      23:27:48.959 -> 2470 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:48.959 -> 2476 TSF:TDI:TSL
      2478 MCO:SLP:WUP=-1
      23:27:49.098 -> 2480 TSF:TRI:TSB
      23:27:49.098 -> 2481 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:49.098 -> 2486 TSF:TDI:TSL
      2488 MCO:SLP:WUP=-1
      23:27:49.235 -> 2490 TSF:TRI:TSB
      23:27:49.235 -> 2492 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:49.270 -> 2497 TSF:TDI:TSL
      2498 MCO:SLP:WUP=-1
      23:27:49.408 -> 2500 TSF:TRI:TSB
      23:27:49.408 -> 2502 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:49.408 -> 2507 TSF:TDI:TSL
      2509 MCO:SLP:WUP=-1
      23:27:49.546 -> 2510 TSF:TRI:TSB
      23:27:49.546 -> 2512 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
      23:27:49.546 -> 2518 TSF:TDI:TSL
      

      Interrupt is triggered and it wakes up, but nothing is sent to the gateway.

      Have i missed something?

      posted in Announcements
      patrikr76
      patrikr76
    • RE: πŸ’¬ Power Meter Pulse Sensor

      Hey guys

      So i am trying to use this sketch with the sleep mode set to true 'cause i need to run it on battery.
      It works fine running with usb power on it and sleep mode on false.
      But with sleep mode true i am getting nothing in myscontroller after the initial startup.
      All i changed is the sleep mode from false to true.
      Running it on a clone nano with some chinese "flame detector" sensor.
      Been trying to figure out if it has something to do with how it reports when in sleep mode but it should still report whatever the send frequency is set to right?
      I was using a tv remote to fake impulses, with seems to work on usb power, but not on battery.
      Any suggestions?

      Best regards
      Patrik

      posted in Announcements
      patrikr76
      patrikr76
    • RE: MYSBootloader 1.3.0-beta.3

      Hello.
      First, thanks to everybody developing all the stuff that is here, these are awesome projects and sorry to resurrect an old thread.

      Second, i am trying to use the firmware update feature from MYSController, build 3316, with MYSBootloader, 1.3.0-rc1 8MHz, on a barebone atmega 328pu 28dip .
      The device is running a simple thermistor sketch and reports happily to my RPi running MySensors ethernet gateway version 2.3.1-alpha(I have tried with version 2.2.0 as well).
      I get the "reboot" screen if i choose the firmware after setting the device as a "Board with MYSBootloader" and the device clearly reboots but does not start any firmware download.

      And of course, i am running nrf24l01+. Device is batterypowered from an 18650 li-ion, through a mcp1700 LDO 3.3v 250mA. 10uF on the nrf between vcc and gnd.
      Device is set to sleep for 60 secs, but is also set to smartsleep for 500ms, as i read somewhere had solved other peoples issues.

      Edit: I believe i was being stupid as i first burned the bootloader using arduino as isp and then burned the sketch, alas, erasing bootloader.

      posted in Development
      patrikr76
      patrikr76
    • RE: πŸ’¬ Motion Sensor

      So i was testing out the motionsensor sketch and it kept giving me "!TSF:MSG:SEND" after the initial 0 had been sent.

      Finding no answers on here i tested loads of things until i tried a delay after the sleep command.
      Running fine now with a 5msec delay.

      Just thought i would share.

      posted in Announcements
      patrikr76
      patrikr76