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
TetnobicT

Tetnobic

@Tetnobic
About
Posts
19
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • NRF24L01+PA+LNA with Raspberry PI 3
    TetnobicT Tetnobic

    @esawyja Perhaps you should be inspired by this :
    https://www.openhardware.io/view/17/Raspberry-Pi2-GPIO-interface-for-NRF24L01

    Hardware

  • Office plant monitoring
    TetnobicT Tetnobic

    Hi,
    in last MySensors lib version 2.1.0, I see a new sensor type : S_MOISTURE
    It's more logicial to use this new type instead of S_HUM ?

    and so use V_LEVEL instead of V_HUM ?

    Thanks for respons

    My Project

  • MYSBootloader 1.3.0-beta.3
    TetnobicT Tetnobic

    @tekka Hi Happy new year 2017 !!!
    Many thanks for release source of MYSBootloader!!! A very good news !!!
    Can you explain how to compile ?
    Makefile in Master Branch failed with :

    make: *** No rule to make target 'MYSBootloader.c', needed by 'MYSBootloader.o'.
    

    I would like to compile an ATMega328 1Mhz version
    Thanks

    Development

  • CDS - Cat Defense System (Arduino + Servo + Motion Sensor)
    TetnobicT Tetnobic

    @MaKin
    I have not done this build, but if I had to do it I will try with this
    The most complicated is to find the Raid Power Sprayer :-)

    My Project

  • CDS - Cat Defense System (Arduino + Servo + Motion Sensor)
    TetnobicT Tetnobic

    Like this: http://lifehacker.com/this-auto-trigger-spray-bottle-pranks-friends-keeps-ca-1555621712

    My Project

  • WS2811 RGB strip lights up in groups of three
    TetnobicT Tetnobic

    @mfalkvidd So where you buy the right led strip ?
    Thanks for your reponse

    Hardware

  • Best way to store large data in eeprom
    TetnobicT Tetnobic

    Just for info, I found others methods to save data in eeprom :
    in <avr/eeprom.h> there is :

    uint8_t 	eeprom_read_byte (const uint8_t *__p)
    uint16_t 	eeprom_read_word (const uint16_t *__p)
    uint32_t 	eeprom_read_dword (const uint32_t *__p)
    float 	eeprom_read_float (const float *__p)
    void 	eeprom_read_block (void *__dst, const void *__src, size_t __n)
    void 	eeprom_write_byte (uint8_t *__p, uint8_t __value)
    void 	eeprom_write_word (uint16_t *__p, uint16_t __value)
    void 	eeprom_write_dword (uint32_t *__p, uint32_t __value)
    void 	eeprom_write_float (float *__p, float __value)
    void 	eeprom_write_block (const void *__src, void *__dst, size_t __n)
    void 	eeprom_update_byte (uint8_t *__p, uint8_t __value)
    void 	eeprom_update_word (uint16_t *__p, uint16_t __value)
    void 	eeprom_update_dword (uint32_t *__p, uint32_t __value)
    void 	eeprom_update_float (float *__p, float __value)
    void 	eeprom_update_block (const void *__src, void *__dst, size_t __n)
    

    It is to these methods that the aliases are made in the file MyHwATMega328.h :)

    #define hwReadConfig(__pos) eeprom_read_byte((uint8_t*)(__pos))
    #define hwWriteConfig(__pos, __val) eeprom_update_byte((uint8_t*)(__pos), (__val))
    #define hwReadConfigBlock(__buf, __pos, __length) eeprom_read_block((void*)(__buf), (void*)(__pos), (__length))
    #define hwWriteConfigBlock(__buf, __pos, __length) eeprom_update_block((void*)(__buf), (void*)(__pos), (__length))
    
    Development

  • Best way to store large data in eeprom
    TetnobicT Tetnobic

    @hek right :) sizeof uint32_t : 4

    it works with :

    #define EEPROM_SLEEP_DURATION_ADDRESS 0
    
    uint32_t sleepDurationInS = 86399;
    
    hwWriteConfigBlock((void*)&sleepDurationInS, (void*)(EEPROM_LOCAL_CONFIG_ADDRESS+EEPROM_SLEEP_DURATION_ADDRESS), 4);
    
     hwReadConfigBlock((void*)&sleepDurationInS, (void*)(EEPROM_LOCAL_CONFIG_ADDRESS+EEPROM_SLEEP_DURATION_ADDRESS), 4);
    
    Development

  • Best way to store large data in eeprom
    TetnobicT Tetnobic

    I try this :

    #define EEPROM_SLEEP_DURATION_ADDRESS 0
    
    uint32_t sleepDurationInS = 86399;
    
    hwWriteConfigBlock((void*)sleepDurationInS, (void*)(EEPROM_LOCAL_CONFIG_ADDRESS+EEPROM_SLEEP_DURATION_ADDRESS), 32);
    
     hwReadConfigBlock((void*)&sleepDurationInS, (void*)(EEPROM_LOCAL_CONFIG_ADDRESS+EEPROM_SLEEP_DURATION_ADDRESS), 32);
    

    but seems no work :( my node freeze at this method

    Development

  • Best way to store large data in eeprom
    TetnobicT Tetnobic

    @mfalkvidd yes for this solution, I guess that hwWriteConfigBlock method access to the eeprom in one time, contrary to bit shifting technique that need 4 saveState so 4 access to the eeprom ?

    Development

  • Best way to store large data in eeprom
    TetnobicT Tetnobic

    @mfalkvidd so not enough to store 1 day (86400s) :( , can I do same things with int32 ?

    Development

  • Best way to store large data in eeprom
    TetnobicT Tetnobic

    @hek thanks for your Nice 3d solution,
    I do not usually use the bit shifting technique, I guess the max value is 8 * 2 bits : 65 535 ?

    @mfalkvidd right 1440 minutes in a day... I am a goat... Thanks for the methods, I think I will use this...

    Development

  • Best way to store large data in eeprom
    TetnobicT Tetnobic

    Hi,
    In my node (ATMega328p) I want to store a duration in seconde in Eeprom....
    This duration can range from 0 to 86400 (1day :))
    I think use the method :
    void saveState(uint8_t pos, uint8_t value);
    but uint8_t can only store value range from 0 to 255 :(

    So, I found 2 solutions :

    • Cut the duration in 2 variables : 1 for minutes, 1 for seconds, and store them at 2 differents positions.
    • Store in a uint32_t type and not use saveState method but use mySensor internal method : hwWriteConfigBlock(__buf, __pos, __length) with the correct param.

    In your opinion, what is the best choice ? or perhaps an other solution ?

    Thanks in advance

    Development

  • Best sensor type and value type for sleep duration...
    TetnobicT Tetnobic

    Hi,
    I try to made a sleeping battery node that wake up every X minutes for send data sensor...
    I dynamically set the duration of sleep (send message from gateway) and store in eeprom.
    My node do a smartSleep for enable receive function and send current value of duration at setup, no technicaly problem on this...
    My question is what sort of message match best for this case ?
    Currently I use :

    MyMessage msgCustom(NODE_CHILD_ID_CUSTOM, V_VAR1);
    

    because I have no found in documentation a value type for duration (in milliseconds or seconds)
    it's the best choice ?

    Thanks

    Development

  • MYSBootloader 1.3pre2 testing
    TetnobicT Tetnobic

    @Anduril I think you can do this without Arduino IDE...
    but how compile you code for generate sketch+bootloader ( the xxx.with_bootloader.hex file) in command line I don't know....
    For upload this file on my ATMega, I use avrdude, the same command line that ardunio IDE use, but change the .hex file...

    Development ota myscontroller mysbootloader

  • MYSBootloader 1.3pre2 testing
    TetnobicT Tetnobic

    @tekka Hi, I found my mistake ! You were absolutely right when you said there is no sign of MYSBootloader in my GW log...
    But now I know why :) :
    I use an USBasp Programmer with Arduino IDE for upload my bootloader and my sketch..., and I mistakenly thought that when I upload bootloader then sketch, it keep bootloader.....but NOT, it overwrite bootloader :(
    I fix it by uploading the xxx.with_bootloader.hex file generated by Arduino IDE when compile.

    Sorry for the inconvenience and thank you for your help

    Development ota myscontroller mysbootloader

  • MYSBootloader 1.3pre2 testing
    TetnobicT Tetnobic

    @tekka Thanks for your response
    What are the sign of MYSBootloader in GW log ?
    Can I also see any sign of MYSBootloader in Node Log ?

    I remove OTA firmware features, I now have :

    Starting sensor (RNNNA-, 2.0.0)
    

    but same problem, after receive reboot message I have a "StartiStartiStartiStartiS...." loop :(:(

    Development ota myscontroller mysbootloader

  • MYSBootloader 1.3pre2 testing
    TetnobicT Tetnobic

    @tekka Thanks for you response
    For gateway :
    Raspberrry PI Gateway in Ethernet mode
    Protocol version : 2.0.1-beta

    For Node :
    I use bootloader : MYSBL13pre_atmega328_1Mhz.hex
    Inital Sketch do nothing :) :

    #define MY_DEBUG
    #define MY_BAUD_RATE 9600
    #define MY_RADIO_NRF24
    #define MY_OTA_FIRMWARE_FEATURE
    #define MY_NODE_ID 1
    
    #include <MySensors.h>
    
    void presentation(){
      sendSketchInfo("MyFirstBoard", "0.0.2", true);
    }
    
    void setup() {
    }
    
    void loop() {
      wait(5000);
    }
    

    Test Case: Start Gateway, Connect MYSController 1.0.0beta, then start my sensor, after init complete, click reboot in MYSController
    Gateway Log :

    mysgw: Starting gateway...
    mysgw: Protocol version - 2.0.1-beta
    mysgw: MCO:BGN:INIT GW,CP=RNNG---,VER=2.0.1-beta
    mysgw: TSF:LRT:OK
    mysgw: TSM:INIT
    mysgw: TSM:INIT:TSP OK
    mysgw: TSM:INIT:GW MODE
    mysgw: TSM:READY
    mysgw: Listening for connections on 0.0.0.0:5003
    mysgw: MCO:REG:NOT NEEDED
    mysgw: MCO:BGN:STP
    mysgw: MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
    
    mysgw: New connection from 10.31.10.59
    mysgw: Client 0 connected
    
    mysgw: TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    mysgw: TSF:MSG:BC
    mysgw: TSF:MSG:FPAR REQ,ID=1
    mysgw: TSF:PNG:SEND,TO=0
    mysgw: TSF:CKU:OK
    mysgw: TSF:MSG:GWL OK
    mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    mysgw: TSF:MSG:PINGED,ID=1,HP=1
    mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=4,t=0,pt=6,l=10,sg=0:FFFFFFFFFFFFFFFF0300
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=0,t=17,pt=0,l=5,sg=0:2.0.0
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    mysgw: Client 0: 1;255;3;0;6;M
    mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=6,pt=0,l=1,sg=0,ft=0,st=OK:M
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=11,pt=0,l=12,sg=0:MyFirstBoard
    mysgw: TSF:MSG:ACK REQ
    mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=11,pt=0,l=12,sg=0,ft=0,st=OK:MyFirstBoard
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=12,pt=0,l=5,sg=0:0.0.2
    mysgw: TSF:MSG:ACK REQ
    mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=12,pt=0,l=5,sg=0,ft=0,st=OK:0.0.2
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    
    mysgw: Client 0: 1;0;3;0;13;0
    mysgw: TSF:MSG:SEND,0-0-1-1,s=0,c=3,t=13,pt=0,l=1,sg=0,ft=0,st=OK:0
    
    

    NodeLog :

    Starting sensor (RNONA-, 2.0.0)
    TSM:INIT
    TSM:RADIO:OK
    TSP:ASSIGNID:OK (ID=1)
    TSM:FPAR
    TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSP:MSG:READ 0-0-1 s=255,c=3,t=8,pt=1,l=1,sg=0:0
    TSP:MSG:FPAR RES (ID=0, dist=0)
    TSP:MSG:PAR OK (ID=0, dist=1)
    TSM:FPAR:OK
    TSM:ID
    TSM:CHKID:OK (ID=1)
    TSM:UPL
    TSP:PING:SEND (dest=0)
    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
    TSP:MSG:READ 0-0-1 s=255,c=3,t=25,pt=1,l=1,sg=0:1
    TSP:MSG:PONG RECV (hops=1)
    TSP:CHKUPL:OK
    TSM:UPL:OK
    TSM:READY
    TSP:MSG:SEND 1-1-0-0 s=255,c=4,t=0,pt=6,l=10,sg=0,ft=0,st=ok:FFFFFFFFFFFFFFFF0300
    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
    TSP:MSG:SEND 1-1-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0
    TSP:MSG:READ 0-0-1 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    TSP:MSG:READ 0-0-1 s=255,c=3,t=6,pt=0,l=1,sg=0:M
    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=11,pt=0,l=12,sg=0,ft=0,st=ok:MyFirstBoard
    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=12,pt=0,l=5,sg=0,ft=0,st=ok:0.0.2
    Request registration...
    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
    TSP:MSG:READ 0-0-1 s=255,c=3,t=11,pt=0,l=12,sg=0:MyFirstBoard
    TSP:MSG:READ 0-0-1 s=255,c=3,t=12,pt=0,l=5,sg=0:0.0.2
    TSP:MSG:READ 0-0-1 s=255,c=3,t=27,pt=1,l=1,sg=0:1
    Node registration=1
    Init complete, id=1, parent=0, distance=1, registration=1
    TSP:MSG:READ 0-0-1 s=0,c=3,t=13,pt=0,l=1,sg=0:0
    StartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiîStartiStartiStartiStartiStartiStartiStartiStartiStartiStartiîStartiîStartiStartiStartiStartiStartiStartiStartiStartiStartiStartiStartiStartiþStartiStartiStartiStartiStartiStartiStartiStartiStartiStartiStarti
    

    Need others infos ?
    Thanks for your time

    Development ota myscontroller mysbootloader

  • MYSBootloader 1.3pre2 testing
    TetnobicT Tetnobic

    Hi,
    I just start to test this bootloader...
    I use an ATmega328p on breadboard with no external clock, with nRF24 and somes sensors.
    Firmware Upload (by usbasp) and Run is ok, Send/Receive Data is ok too , but when I ask a reboot (with MYSController 1.0.0beta), my node enter in sort of strange start loop...
    My Fuse settings :

    bootloader.unlock_bits=0x3F
    bootloader.lock_bits=0x0F
    bootloader.low_fuses=0x62
    bootloader.high_fuses=0xDA
    bootloader.extended_fuses=0x07
    

    Node debug Trace :

    .....
    TSP:MSG:READ 0-0-4 s=2,c=1,t=0,pt=7,l=5,sg=0:28.18
    TSP:MSG:READ 0-0-4 s=1,c=1,t=1,pt=7,l=5,sg=0:38.28
    TSP:MSG:READ 0-0-4 s=0,c=3,t=13,pt=0,l=1,sg=0:0
    StartiStartiStartiStartiþStartiþStartiþStartiStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþStartiþ
    ....
    

    The "Startiþ" text is the first char of the first text printed by bootloader at start : "Starting sensor....."
    Have you an idea ?

    Thanks

    Development ota myscontroller mysbootloader
  • Login

  • Don't have an account? Register

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