Navigation

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

    Jens Jensen

    @Jens Jensen

    6
    Reputation
    28
    Posts
    259
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Jens Jensen Follow

    Best posts made by Jens Jensen

    • RE: Raspberry Pi rf24 mqtt gateway not working

      Ok, this was super silly resolution.

      I had wrong CE pin selected, and confusion bit me again on the pin vs gpio thing of the header/brcm gpio mapping.

      On my rf24 module, I had (from previous implementations) wired up CE to GPIO 22 (pin 15), and IRQ to GPIO 25 (pin 22). So default CE line for rpi/rf24/mysgw is "22" (pin, NOT gpio πŸ˜‰

      The frustration was that my module was being recognized, which gave false appearance of complete wiring correctness, but I think it never transitioned to TX.
      Not sure if it would be possible to sanity check RF24 driver to verify if CE line is working in module wiring or not.

      Anyhow, moral of the story is to check and double-check the wiring!!!

      posted in Troubleshooting
      Jens Jensen
      Jens Jensen
    • RE: πŸ’¬ Log Parser

      I also found the logparser did not handle certain log entries, such as the logfile produced by the mysensors gateway on raspberry pi, e.g. prefixed with timestamps, etc.

      Opened pull request to improve this, comments welcome, especially if you are able to test this locally (only need to copy the Logparser directory and open logparser.html locally in a browser):
      https://github.com/mysensors/MySensors/pull/1468

      posted in Announcements
      Jens Jensen
      Jens Jensen
    • RE: Waterproofing by embedding in epoxy

      Great Scott! channel did a few great videos on this:
      https://www.youtube.com/watch?v=pGLUsQozT94
      How to Waterproof Electronics || Nail Polish, Silicone, Potting Compound – 07:49
      β€” GreatScott!

      (I have been using cheap clear nail polish from dollar store, and it seems like it works for moisture protection... not using for submersion however.)

      posted in General Discussion
      Jens Jensen
      Jens Jensen
    • RE: [Solved] Device and gateway see each other, but not regestering

      @magpern

      for others trying to find a good channel, I found this useful showing Wifi and BLE channels. (Orange are BLE advertising channels, which should always be reserved/unoccupied by NRF stuff):
      wifi-bluetooth-channels
      Yes I think wifi channels >11 (like 12,13,14 overlap to 2476).
      So sometimes nrf channel 1 is a good choice, but as always, depends on your environment πŸ˜‰
      Do you have wireless mice, keyboards, etc - many of these use NRF24 or similar 2.4GHz ISM? Are you sure the other 2.4GHz devices are really bluetooth and not proprietary?

      posted in Troubleshooting
      Jens Jensen
      Jens Jensen
    • RE: Waterproofing by embedding in epoxy

      @Dreded
      FWIW, I don't have direct experience myself with longevity and durability of heatshrink + hot glue, but one of the YT channels I follow does. Julian Ilett has a custom-built pwm solar charge controller which he made small production runs of, and started having failure issues with this method, as these are exposed to outdoor environmental conditions.
      Autopsy: Faulty PWM5 Solar Charge Controller – 16:40
      β€” Julian Ilett

      however, I would think that "potting" or filling the heatshrink openings with "RTV" (i.e. room-temperature vulcanizing) silicone sealant. This stuff is used on marine and aircraft applications to completely waterproof stuff.

      posted in General Discussion
      Jens Jensen
      Jens Jensen

    Latest posts made by Jens Jensen

    • RE: VL53L0X with water tanks

      Just to mention some proven alternative approaches for your research if you haven’t already considered them:

      • float level sensors
      • ultrasonic level sensors
      • capacitive level sensors
      posted in Troubleshooting
      Jens Jensen
      Jens Jensen
    • RE: πŸ’¬ Log Parser

      I also found the logparser did not handle certain log entries, such as the logfile produced by the mysensors gateway on raspberry pi, e.g. prefixed with timestamps, etc.

      Opened pull request to improve this, comments welcome, especially if you are able to test this locally (only need to copy the Logparser directory and open logparser.html locally in a browser):
      https://github.com/mysensors/MySensors/pull/1468

      posted in Announcements
      Jens Jensen
      Jens Jensen
    • RE: Cross compile mysensors gateway

      maybe a good knowledge resource for cross-compilation against rpi targets:
      https://tttapa.github.io/Pages/Raspberry-Pi/C++-Development/Building-The-Toolchain.html

      posted in General Discussion
      Jens Jensen
      Jens Jensen
    • RE: Started with MySensors and about to give up (some feedback)

      FWIW,
      on a more specific tweak, one of the things I struggled with for a while was why the mysensors defaults for RF24 transport use tx power level RF24_PA_HIGH (-6 dBm) by default instead of RF24_PA_MAX (0 dBm)

      I wound up setting:
      #define MY_RF24_PA_LEVEL (RF24_PA_MAX)
      in all my sketches, as it seems to make the difference for those several walls and/or extra few meters of range.

      (Not sure why the -6 dBm setting was chosen?)

      posted in General Discussion
      Jens Jensen
      Jens Jensen
    • RE: Anyone tried the stc15l204? It appears to be an inexpensive integrated mcu + NRF24L01+

      Very easy to program with SDCC (via makefiles and/or vscode/platformio), however, it's all pure C, and I dont know if anyone has any recent C-only implementations of mysensors (it all seems to be C++).

      https://github.com/zerog2k/stc_blinky

      Also, the STC15F204EA (or STC15L204EA) are probably the least capable - only 256b ram, 4k code, and no hardware uart/spi, etc. The can do some basic RF24 tasks, but I doubt they could handle the full mysensors state machine.

      There are the more capable versions, e.g. STC15W408AS, etc with more ram (2-4k), code (8+ kB), and a basic set of peripherals (hw uart, spi, etc) - however still far underperforming typical arduino (atmega328p) specs.

      posted in Hardware
      Jens Jensen
      Jens Jensen
    • RE: Waterproofing by embedding in epoxy

      @Dreded
      FWIW, I don't have direct experience myself with longevity and durability of heatshrink + hot glue, but one of the YT channels I follow does. Julian Ilett has a custom-built pwm solar charge controller which he made small production runs of, and started having failure issues with this method, as these are exposed to outdoor environmental conditions.
      Autopsy: Faulty PWM5 Solar Charge Controller – 16:40
      β€” Julian Ilett

      however, I would think that "potting" or filling the heatshrink openings with "RTV" (i.e. room-temperature vulcanizing) silicone sealant. This stuff is used on marine and aircraft applications to completely waterproof stuff.

      posted in General Discussion
      Jens Jensen
      Jens Jensen
    • RE: A water pulse meter using interrupts and the ATMEGA328P "power save" mode

      So this is where I see for atmega 168/328, Tone lib is modding Timer2:
      https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/Tone.cpp
      So that's why it's important to explicitly set every Timer2 register.

      Reviewing AVR130 app note, I think I was incorrect about being able to sleep and externally clock T1 (to count pulses), as T0/T1 seem to be synchronous, meaning they require the system (i/o) clock to be running to latch in the edges of external source, and only IDLE power save mode supports running the clk_io. This mode will use way more current, e.g. w/ internal rc osc at 8MHz at 3.3v about 700uA.

      Seems that only Timer2 can allow an "asynchronous" external clocking event (pulse counting) with cpu clocks off (in very low power modes).

      Just blabbering, yet another aproach could be to, instead of bothering with RTC crystal on Timer2:

      1. use watchdog timer as a wakeup (interrupt only) source, for either an approximately 4 or 8 second interval (5 mins = 300 secs, 300 / 4 = 75 wakeups)
      2. use Timer2 as external event counter to count the pulses (without interrupt/wakeup?)

      regarding the mysensors lib, I'm not an expert, but reviewing the code, seems like you covered it:
      mysensors sleep overloads call _sleep in MySensorsCore.cpp
      https://github.com/mysensors/MySensors/blob/master/core/MySensorsCore.cpp#L562
      which call transportDisable() like you do then call hwSleep() variants in MyHwAVR.cpp (depending upon how you call sleep, e.g. with pin interrupt setups or not), which eventually call hwPowerDown()
      https://github.com/mysensors/MySensors/blob/master/hal/architecture/AVR/MyHwAVR.cpp#L83
      which seems to do pretty much what you are doing (maybe a few other things, etc..) to call sleep. ref: https://www.microchip.com/webdoc/AVRLibcReferenceManual/group__avr__sleep.html

      So I dont really see any additional state machine stuff happening w.r.t. MySensors itself.

      posted in Troubleshooting
      Jens Jensen
      Jens Jensen
    • RE: A water pulse meter using interrupts and the ATMEGA328P "power save" mode

      @Encrypt
      yes, interesting... i also had strange issues trying to implement rtc first time, but it was due to arduino lib mucking with Timer2 registers (due to Tone libs). The answer was to make sure all registers were not assumed to be default, but explicitly set in setup(). You seem to have that here.
      I did a quick scan of mysensors repo code, but I don't see where it is touching any of Timer2's registers, so not sure.
      Did you toggle led/pin in the current code's ISR, to be 100% sure your the issue is that the isr is getting triggered at unexpected interval? (maybe sanity check that with scope.) That should bifurcate the problem either to the timer implementation/configuration, or something else.

      @zboblamont I also agree here. But it should be totally possible to setup Timer1 as externally clocked counter, i.e. pulse from meter can increment Timer1 counters without interrupting CPU from sleep, and only interrupt and increment another counter variable on Timer1 overflow (if it happens) so you can be sure you have complete, accurate count when you wake up from your long sleep to do your accounting and reporting.

      Briefly looking at the datasheet for the water sensor, I didn't get a sense of what the unit of water volume/flow a single HF pulse means. Depending on what this unit is, and how often you wakeup and check the T1 counter value, it may not even be necessary to bother with handling counter overflow, e.g. pulses = 1 liter; would you ever consume >65kL in <10 mins?
      In this case, you only simply need to worry about waking up from long sleep interval, polling and clearing counter, sending, and going back to sleep.

      posted in Troubleshooting
      Jens Jensen
      Jens Jensen
    • RE: A water pulse meter using interrupts and the ATMEGA328P "power save" mode

      also, declaring static var inside isr is strange to me (maybe it works?) but I have always seen that you should declare any vars to be manipulated in isr to be global and volatile

      posted in Troubleshooting
      Jens Jensen
      Jens Jensen