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
  1. Home
  2. Development
  3. Eeprom access via mySensors

Eeprom access via mySensors

Scheduled Pinned Locked Moved Development
readmanagementeepromwritestructured
9 Posts 2 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • klimK Offline
    klimK Offline
    klim
    wrote on last edited by
    #1

    Hi i hope you can help me finding a solution for my requirement. I want eeprom content to be fully manageable via mySensors protocol using payload.
    The previous days I've tried a few solutions but I'm unsatisfied with all of them, here are some of my unusable solutions:

    • Each eeprom value has it's own function for accessing --> stupid solution e.g. Payload: readValue1
    • Direct access eeprom addresses --> hassle solution without structured access, datatype length problem. e.g. Payload: %command%,%address%,%value% --> write,0x10,255

    Please note, the above Payload examples aren't real, they are just for better description.

    I want a generic solution to manage eeprom values with the use of structured eeprom access, optionally where the node can give information about it's structure (variables and datatypes) to the controller for easier management. Do you have any ideas who to do that, please?

    hekH 1 Reply Last reply
    0
    • klimK klim

      Hi i hope you can help me finding a solution for my requirement. I want eeprom content to be fully manageable via mySensors protocol using payload.
      The previous days I've tried a few solutions but I'm unsatisfied with all of them, here are some of my unusable solutions:

      • Each eeprom value has it's own function for accessing --> stupid solution e.g. Payload: readValue1
      • Direct access eeprom addresses --> hassle solution without structured access, datatype length problem. e.g. Payload: %command%,%address%,%value% --> write,0x10,255

      Please note, the above Payload examples aren't real, they are just for better description.

      I want a generic solution to manage eeprom values with the use of structured eeprom access, optionally where the node can give information about it's structure (variables and datatypes) to the controller for easier management. Do you have any ideas who to do that, please?

      hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      @klim

      I have noted the request.

      1 Reply Last reply
      0
      • klimK Offline
        klimK Offline
        klim
        wrote on last edited by
        #3

        Hi, just wanted to ask about any ideas, not to make a feature request. But in general i think this could be useful for the whole mySensors project.
        What i built already:

        -Used the EEPROMAnything.h library for structured eeprom access
        -Wrote a Payload parser for: command,section,value e.g. write,value1,199
        -But then i've a problem to access the struct sections

        Here's an excerpt about my solution:

        struct store_t {
        byte version;
        int value1;
        unsigned long value2;
        char code[5];
        } configuration;

        The parser separates the Payload into:
        -command <-- e.g. write
        -section <-- e.g. value1
        -value <-- e.g. 199

        To read data from the struct i can simply use** configuration.value1** which works fine.
        But i want to use the data from the Payload like ** configuration.section** where the section holds the struct section name to access.
        The only nasty solution i figured out was, comparing the Payload section with a string.

        if (strcmp(payload,"value1") == 0) {
        Serial.println(configuration.value1);
        } else
        if (strcmp(payload,"value2") == 0) {
        Serial.println(configuration.value2);
        }

        How could i do that better?

        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          It is a hard to solve it any other way if you use a string as identifier.

          1 Reply Last reply
          0
          • klimK Offline
            klimK Offline
            klim
            wrote on last edited by
            #5

            Thanks for reply. This means, my it is not possible do it that way, right?
            Any other ideas to generalize eeprom access?

            1 Reply Last reply
            0
            • hekH Offline
              hekH Offline
              hek
              Admin
              wrote on last edited by
              #6

              You could for instance use a index + length to access a certain a region in the eeprom pretty easy. But remember there are a limit on the size of payload.

              1 Reply Last reply
              0
              • klimK Offline
                klimK Offline
                klim
                wrote on last edited by
                #7

                I already mentioned direct access eeprom addresses. I don't like it, because of loosing all the benefits of structured eeprom access.

                1 Reply Last reply
                0
                • hekH Offline
                  hekH Offline
                  hek
                  Admin
                  wrote on last edited by
                  #8

                  You could read-up on and get inspired of protocol buffers. Pretty neat.

                  https://developers.google.com/protocol-buffers/

                  1 Reply Last reply
                  0
                  • klimK Offline
                    klimK Offline
                    klim
                    wrote on last edited by
                    #9

                    thanks, i'll give it a try.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    15

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.0k

                    Posts


                    Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

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