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. Combining Adafruit FONA library with MySensors

Combining Adafruit FONA library with MySensors

Scheduled Pinned Locked Moved Development
9 Posts 2 Posters 3.2k 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.
  • GertSandersG Offline
    GertSandersG Offline
    GertSanders
    Hardware Contributor
    wrote on last edited by GertSanders
    #1

    Question for @hek : how much dynamic memory needs to be free to be able to run MySensors library (I'm still using 1.5 btw)?

    If I compile my code I now have used 17.198 bytes of program memory and have defined 1532 bytes of global memory.

    I declared MySensor and MyMessage (for S_INFO use) - is part of the 17K code.

    If I do declare the "begin" I end up with 23.244 bytes used in program memory, and using 1571 bytes of global memory (and of course a low memory warning from the IDE).

    The fixed nodeID is intentional. I figure my SMS "gateway" needs a fixed address.

    Anyone with experience combining the FONA (1.1.1 from Adafruit) and MySensor libraries (1.5) ?

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

      It depends. The linker does a good job removing stuff you don't use. But there seem to be alot of overhead when using C++.

      In the development branch I've tried to keep the C++ class usage to a minimum which result in about 20% smaller library (once again depending on which features you enable).

      Suggest you try dev-brach if you're trying to combine it with a large library.

      1 Reply Last reply
      0
      • GertSandersG Offline
        GertSandersG Offline
        GertSanders
        Hardware Contributor
        wrote on last edited by
        #3

        hi Henrik, I was hoping you would reply.

        So far I found that I need to stay above the 512 bytes of available global memory to allow use of MySensors in combination with the Fona library. I can send all received SMS text to Domoticz via the S_INFO type (I have an SMS800L hooked up to an atmega328p node), so that would allow the controller to take action on an SMS received in the MySensor network. At the same time I would like some more room for standard SMS message (160 bytes). So far I had to limit myself to 60 bytes per message.

        I will try the DEV branch, and I looked for it on GITHUB, but it is not clear to me how I would download the arduino dev-branch library. Some changes in declaration are also needed I see. I was waiting for some more documentation before jumping.

        1 Reply Last reply
        0
        • GertSandersG Offline
          GertSandersG Offline
          GertSanders
          Hardware Contributor
          wrote on last edited by
          #4

          Switching of DEBUG in MyConfig.h did the trick so far, back up to 160 chars for a message :-)

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

            To get and keep a fresh copy of the dev-branch I suggest you install git and run

            > git clone https://github.com/mysensors/Arduino.git

            If you later need to do a update to the latest library version just do

            > git pull

            1 Reply Last reply
            0
            • GertSandersG Offline
              GertSandersG Offline
              GertSanders
              Hardware Contributor
              wrote on last edited by GertSanders
              #6

              My source code is on Dropbox, so are my libraries (allows me to develop at home on a Mac en at work on a PC). So I assume I will need some form of sync setup to keep in line with the dev branch. As far as I know I can not set up a git on Dropbox from my Mac, right?

              1 Reply Last reply
              0
              • GertSandersG Offline
                GertSandersG Offline
                GertSanders
                Hardware Contributor
                wrote on last edited by
                #7

                Am I correct in assuming the maximum payload of a V_TEXT is 25 characters ?

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

                  As long as you can mount your dopbox in the filsystem (like you can do for google-drive) I see no problem of keeping your clone there.

                  Yes, max payload is about 25 characters for the NRF-radio when header has been removed. With RF69 you have a few bytes more.

                  1 Reply Last reply
                  0
                  • GertSandersG Offline
                    GertSandersG Offline
                    GertSanders
                    Hardware Contributor
                    wrote on last edited by
                    #9

                    That simplifies my issue. I was trying (and now succeeded) to handle 160 char SMS messages (with DEBUG off), but the payload of S_INFO is the limiting factor. So now I can use a 30 char buffer AND keep DEBUG on, which is better for development.

                    I will try to set up to git on dropbox, it is indeed transparent for my PC, not so sure about the Mac.

                    And I still need to do the writeup for connecting the NRF24 directly to the Raspberry as a gateway :-)

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


                    20

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 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