Menu

Protocol Document needs to add ":" lead character for commands

SHillier
2023-02-13
2023-02-19
  • SHillier

    SHillier - 2023-02-13

    I was playing with making a driver for Indi and was having weird results until I looked at the protocol document for the myFP2 comms protocol document since that Indi driver works well. The myFP2 protocol documentation mentions that all commands require a leading colon ":" and are terminated by an octothorp "#". The myDCP4ESP32 protocol document does not mention the leading colon but once added everything seems to be working.

    Quickly checking comms.h it is processing the command string assuming a leading character.

     
  • brownrb

    brownrb - 2023-02-14

    Hi
    In the upcoming release, many things get changed, delected, and added. This means some commands are deprecated, changed or added.

    The protocol document outlines the codes that are used, and stipulates the # as the end of command. However, it failed to mention that commands start with :

    I should be ready in about 2-3 weeks to start the tesing of the new firmware. It has taken a significant amount of time so far.

    Will be interested to see your driver once the new firmware is ready to use.

    Regards
    Robert

     
  • SHillier

    SHillier - 2023-02-15

    Look forward to trying out the new firmware.

    Even though there will be lots of changes I hope you won't mind me reporting issues with the current version when I run into them.

    The set tracking offset command doesn't work for negative values. There's a cast to byte when the :19value# command is received. Its supposed to accept an int from -4 to 3 but the cast effectively forces to uint. In the comms.h line 410:

        case 19:      // Set tracking offset value
          mySetupData->set_trackingoffset((byte)workString.toInt());
          break;
    

    Should be:

        case 19:      // Set tracking offset value
          mySetupData->set_trackingoffset(workString.toInt());
          break;
    

    Looks like the code will accept a float for the channel and ambient offsets. Maybe the tracking offset should also accept a float?

     
  • brownrb

    brownrb - 2023-02-15

    I guess there are some things carried over from the much older nano code, that being one of them. issues of space and speed were at that time paramount.

    Thanks, I will check to see how that is handled in the new code.

    Regards
    Robert

     
  • SHillier

    SHillier - 2023-02-16

    Pretty well have the INDI driver working. At least for TCP. I don't have mine set up for serial connection.

    Found a couple other bugs.

    First is with overrides.I don't use override switches but when using the set override command I found the previously reported problem of all channels going to 100%. In dewchannels.h the getpwr proceedure there's a check for channel overide in each channel from lines 565 to 670. The channel isn't passed into the getpwr only temp and trackmode so if any channel is in overide it returns 100% power for all calls. Removing the checks at the end of getpwr fixes it since you check for the override settings where getpwr is called from gettemps in temperatureprodes.h.

    Second is just a missing break statement in the command processing code in comms.h. There's no break after case 35 so a call to command 35 also caused 36 to be processed. Inserting a break fixed it.

     
  • brownrb

    brownrb - 2023-02-17

    Thanks,

    Serial support is deprecated in next release, so don not put too much effort into Serial.

    regards
    Robert

     
  • SHillier

    SHillier - 2023-02-18

    Well then, I'm pretty much done for now. Serial is there but not tested. I also have a check for firmware version greater than 109. Greater than 109 enables tracking offset and the 100% boost buttons while with 109 they are removed. I set the firmware version of my copy to 110 after making the changes I mentioned.

    Screen captures attached. Three tabs. A "Main Control" tab to display temp, humidity and power that also allows tracking mode selection. A "Connection" tab and an "Options" tab. The Options tab allows setting of the channel offsets, tracking offset, 100% boost and CH3 mode with power setting if in Manual mode. The only config saved with Save configuration is the polling period. Everything else is pulled from the controller.

     
  • brownrb

    brownrb - 2023-02-19

    Awesome, great news. Can I use those in the next pdf?

    The protcol for the next firmware release v110+ I attach, as you can see, massive changes. Please send an email to my gmail account and I will grant you access ti the new beta,

    Regards
    Robert

     
  • SHillier

    SHillier - 2023-02-19

    NP, you're welcome to use the images. I haven't created a pull request in the main INDI repo yet since I figured I'd wait for your new firmware. INDI just released V2.0.0 on Feb 1st so it will be April before the next release.

    A quick look at the protocol doc and it doesn't look like any of the commands I implemented we're impacted. At least by protocol changes. I only implemented the core dew heater functional commands so any changes to commands for RTC/NTP, the display or MQTT won't impact the driver.

    I also didn't add the set controller mode to controller versus app since it didn't seem that app control could do much other than set channels to 100% or off.

    I'll send you an email and thanks for access to the beta.

    Stephen.

     

Log in to post a comment.