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
I

igo

@igo
About
Posts
4
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • No merge into master in the last 5 years, should we use development?
    I igo

    @skywatch said in No merge into master in the last 5 years, should we use development?:

    https://www.hackster.io/TMRh20/iot-home-automation-w-nrf24l01-raspberry-pi-9ee904

    from my point of view, community is moving towards zigbee, lora and meshtastic

    General Discussion

  • Raspberry Pi 5: invalid GPIO 9
    I igo

    Hi,
    after migrating to RPi5 from RPi4 I cannot run mysgw:

    pi@pi:~/projects/MySensors $ ./configure --my-transport=rf24 --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mysgw1
    pi@pi:~/projects/MySensors $ make
    pi@pi:~/projects/MySensors $ sudo ./bin/mysgw 
    Aug 27 15:16:32 INFO  Starting gateway...
    Aug 27 15:16:32 INFO  Protocol version - 2.4.0-alpha
    Aug 27 15:16:32 DEBUG MCO:BGN:INIT GW,CP=RNNGL---,FQ=NA,REL=1,VER=2.4.0-alpha
    Aug 27 15:16:32 DEBUG TSF:LRT:OK
    Aug 27 15:16:32 DEBUG TSM:INIT
    Aug 27 15:16:32 DEBUG TSF:WUR:MS=0
    Aug 27 15:16:43 ERROR Could not open /sys/class/gpio/gpio9/direction
    

    Any idea what is happening or how can I debug it? I found this which says "raspi-gpio is deprecated and doesn't support Pi 5".

    Troubleshooting

  • My HW gives me wrong battery voltage
    I igo

    @ejlane @eiten problem is that before any calculations sensorValue from analogRead is 127. So if I use 127 in any formula it's doesn't make and reasonable value.

    1000000/(1000000+470000)*127 = 86,3945578231

    I took the formula from https://www.mysensors.org/build/battery#external-measurement. R1 and R2 names (not values) are swapped in my schematic :-/

    Btw, board was meant to be power by 1,2,3 or 4 AA batteries. It's powered by TPS61025DRCR. But I am not sure I did the power management correctly.

    Hardware

  • My HW gives me wrong battery voltage
    I igo

    Hi,
    I've built my very first PCB with atmega328p-au. Everything works fine (MCU, sensor, radio) except battery measurement. It always give me 0.4V regardless of what battery is connected (1,5V 1xAA or 3V 2xAA).

    const float VOLTAGE_DIVIDER_R1 = 1e6;
    const float VOLTAGE_DIVIDER_R2 = 470e3;
    uint8_t BATTERY_SENSE_PIN = A1;
    
    void setup() {
      // use the 1.1 V internal reference
    #if defined(__AVR_ATmega2560__)
      analogReference(INTERNAL1V1);
    #else
      analogReference(INTERNAL);
    #endif
    }
    ...
    // gives me 127
    int sensorValue = analogRead(BATTERY_SENSE_PIN);
    
    
    // 3.440426e+00
    const float voltageDivider = ((VOLTAGE_DIVIDER_R1+VOLTAGE_DIVIDER_R2)/VOLTAGE_DIVIDER_R2)*1.1;
    
    // 3.363075e-03
    const float voltsPerBit = voltageDivider/1023;
    
    // 0.43 V
    float batteryV = sensorValue * voltsPerBit; // calculated
    

    R1 = 470K
    R2 = 1M
    C3 = 100nF
    C3 is connected to A1

    Any idea what could be wrong?

    Screenshot 2023-04-04 at 21.53.34.png

    2a0ed1b0-de33-4d5d-b2fa-a13c830f2ce0-image.png

    Hardware
  • Login

  • Don't have an account? Register

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