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

Sabin

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: EspressifESP32 #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.

      in reply to: EspressifESP32 #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.

         

         

        in reply to: EspressifESP32 #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

          in reply to: EspressifESP32 #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.

            in reply to: Secure Client for DigiXbee #19725
            Sabin
            Participant

              Thanks for the reply.
              So, how do I even do POST request to server running on the web? Are there any Wifi modules that are alternative to Xbee that supports SecureClient?

              in reply to: DigiXBeeWifi class mqtt codeflow example #19624
              Sabin
              Participant

                Thank you for your response.
                I used TinyGSM directly and got into this problem. I was deploying broker locally,, the code on the inside check for dns lookup.. Currently I commented this code out and tinygsm works.
                https://github.com/issues/created?issue=vshymanskyy%7CTinyGSM%7C854

                This is what my full code looks without tinygsm:

                This is how I am implementing tinygsm

                Tinygsm implementation will result in flaky broker connection like this:
                1773954855: New client connected from 144.39.141.49:49164 as ArduinoTempSensor (p4, c1, k15). 1773954865: Client ArduinoTempSensor [144.39.141.49:49164] disconnected: connection closed by client. 1773954865: New connection from 144.39.141.49:49165 on port 1883. 1773954865: Protocol error from 144.39.141.49:49165: First packet not CONNECT (30). 1773954865: Client 144.39.141.49 [144.39.141.49:49165] disconnected: protocol error.

                in reply to: DigiXBeeWifi class mqtt codeflow example #19622
                Sabin
                Participant

                  Thank you for your response.
                  I think it’s the master branch.

                  Also, this is what I am trying to do.

                  DigiXBeeWifi modemXBWF(&Serial1, powerPin, statusPin, false,
                  modemResetPin, modemSleepRqPin,
                  ssid, pwd, false);

                  Client* netClient = nullptr;
                  MqttClient* mqttClient = nullptr;

                  void setup() {
                  Serial.begin(9600);
                  Serial1.begin(9600);
                  delay(2000);

                  if (!modemXBWF.connectInternet(60000L)) {
                  Serial.println(“WiFi failed!”);
                  return;
                  }
                  Serial.println(“WiFi connected!”);

                  delay(1200);

                  netClient = modemXBWF.createClient();
                  mqttClient = new MqttClient(*netClient);

                  <div>Somehow this code is called. bool DigiXBeeWifi::extraModemSetup(void). I don’t know which line does this. So the broker connection fails.
                  I have used this workaround by implementing the Client with just a fake abstract wrapper and preconnect xbee s6b with xctu…
                  class XBeeTransparentClient : public Client {
                  public:
                  XBeeTransparentClient(Stream& s) : _stream(s) {}int connect(IPAddress ip, uint16_t port) override { return 1; }
                  int connect(const char* host, uint16_t port) override { return 1; }
                  void stop() override {}
                  uint8_t connected() override { return 1; }
                  operator bool() override { return true; }

                  size_t write(uint8_t b) override { return _stream.write(b); }
                  size_t write(const uint8_t* buf, size_t size) override { return _stream.write(buf, size); }
                  int available() override { return _stream.available(); }
                  int read() override { return _stream.read(); }
                  int read(uint8_t* buf, size_t size) override { return _stream.readBytes(buf, size); }
                  int peek() override { return _stream.peek(); }
                  void flush() override {}

                  private:
                  Stream& _stream;
                  };

                  </div>

                Viewing 7 posts - 1 through 7 (of 7 total)