Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

EspressifESP32

Home Forums Mayfly Data Logger EspressifESP32

Viewing 7 reply threads
  • Author
    Posts
    • #19738
      Sabin
      Participant

        How to connect to Wifi while using this in Mayfly data logger?
        I have been trying this codebase or even the one with tinygsm library but nothing works. Is there any pre-configuration that is needed to be done?

         

      • #19739
        Sabin
        Participant

          Never mind. The wifi worked. I used AT+CWMODE? and change it from SoftAP to Station mode.
          But I am struggling to use this to connect to mqtt broker.

        • #19766
          Sara Damiano
          Moderator

            Were you able to connect to your MQTT broker?

            It looks like you’re working from the modem component within Modular Sensors.  That component wraps TinyGSM and adds physical pin support for power management.  But the wrapping makes it a bit confusing because you have to access objects with pointers and creator functions.  And if you’re trying to use the ModularSensors master branch as of 8/4/26, it’s broken.  (The last release is fine, just not the current master branch.) Until you have your communication set, I would work directly from the TinyGSM example set which is more direct.  After you’ve got your communication set, figure out power.

          • #19767
            Sabin
            Participant

              I have.
              Before opening a tcp connection, the Socket Receiving Mode should be made to 1 (passive mode). I have no idea why it works only while doing this. But it works.

              I found the modularsensor implementation difficult. Therefore wrote my own small class that wraps tinygsm for the functions that I need.

              One thing I found is modemBaud is 57600 which is different from the comments in the esp class

            • #19768
              Sara Damiano
              Moderator

                Are you using the original TinyGSM or the EnviroDIY fork? The EnviroDIY fork is far ahead of the original right now.  (It’s on my to-do list to have a proper PR.)

                I’d (strongly) recommend updating your AT firmware.  The current version of TinyGSM on the EnivroDIY fork expects firmware >= 3.2.0.0.  Because of changes in the memory mapping for SSL certificates (and other stuff) around version 3.2, you’ll need to completely re-flash the board with esptools/ESP flash download tools instead of using the AT+CIUPDATE function.

              • #19769
                Sabin
                Participant

                  I am using EnviroDIY fork. Until now everything is working. I am able to make both http post, and mqtt connection.
                  I checked and mine esp32 firmware version is 2.4.0. So,Is it because of this lower version, I had to do some hack around for ssl connection?
                  Below is the part of workaround I coded to make it work with hydroserver.

                   

                   

                • #19770
                  Sara Damiano
                  Moderator

                    Yes, those are because of the old firmware. If you’ve got it working, it may not be worth updating, but it should eliminate those work-around.

                    If you want to use custom SSL certificates, upgrade. The only way to push custom certificates with the old firmware (or with an ESP8266) is to use a python script to write the memory blocks with the new certificate data. And getting that working is much harder than upgrading the firmware. AWS IoT core requires custom certificates.

                  • #19771
                    Sabin
                    Participant

                      Thank you so much.

                      I am not using the AWS stuff for now but I will be deploying mosquitto on cloud at some time.
                      if this old firmware create problem at that point, I will update the firmware.
                      Thank you again.

                  Viewing 7 reply threads
                  • You must be logged in to reply to this topic.