TimeStamp not working

Viewing 2 reply threads
  • Author
    Posts
    • #30244
      William
      Moderator

        Have struct Message{
        int switchState;
        String timeStamp;
        }message;

        SwitchState is sent to E220 receiver. TimeStamp only prints non-printable characters to E220 receiver. TimeStamp is populated on E220 sender by the getDateTime functio variable dtStamp. I can print message.timeStamp and see a properly formatted time stamp on the E220 sender. Have worked this issue for hours; help would be much appreciated.

        Regards,
        William

        • This topic was modified 1 year, 6 months ago by William. Reason: Removed image; imsge is in the zip file attachment
      • #30251
        Renzo Mischianti
        Keymaster

          Hi William,
          if you want to use a Structure, you must use fixed size variables. String is dynamic, and the receiver can’t know the correct size.

          Try to use something like this.

          
          Have struct Message{
          int switchState;
          char[13] timeStamp;
          }message;
          

          Bye Renzo

        • #30261
          William
          Moderator

            Thank you Renzo; have it working now.

            New project is a remote battery monitor with NTP timestamp transmitter to E220 receiver. Have nearly all of the project compeled; except for a “Timeout!!” message on Serial Monitor I did not code, sketch continues to run. Is this a warning from the E220 library? Message occurs between a httpClient function and logBattery function. Have removed all delays; no change.

            Project logs timestamp, adc reading, and voltage to LittleFS. Going to try and find out how long battery lasts compared to the number of requests made using an automated method of generating GET requests.. conditonal statement determine how often request are made to AsycWebServer. Server switches on live video camera for a predetermined period using a once Ticker timer method.

            Plan to use a voltage divider of 1 meg ohm and 2 meg ohm; need to aquire the parts. Getting together a shopping list for your shields too. Thanks for creating the shields and your community support!

            Regards,
            William

            • This reply was modified 1 year, 6 months ago by William.
        Viewing 2 reply threads
        • You must be logged in to reply to this topic.
        Exit mobile version