[OpenTRV-interest] Programatically sending command to an OpenTRV board

Damon Hart-Davis EMAIL ADDRESS HIDDEN
Thu Nov 6 18:36:01 GMT 2014


Hi,

I’ll try to reply to this properly tomorrow, but here are some quick responses to your specific questions below:

> 
> 1. When exactly I should "reply" to the ">" prompt (I'm sorry, it
> might be obvious to some, from UI_Minimal.cpp, but C is somewhat
> foreign to me; actually perl is too). I thought that it should be
> after the ">" but before the line endings, but since I'm having no
> success, i’m asking here, to be sure.

After the > and within a small amount of time before the CRLF, somwhere between about 100ms and 2s depending what else the unit has to get done.

> 2. Should I, or MUST I send line endings after my "S" command, and if
> so, what might be preferred? The comment that I quoted within the code
> above suggests that either CR or CRLF would be acceptable. Actually,
> I'm not sure how I would vary this anyway, but I'm asking, just in
> case it really matters.

I have set up my Arduino IDE to send CRLF when I press the send button, either on its own should suffice.

When I interact from the Java code for the Raspberry Pi I just send a CR (‘\n’).


> 3. Is it possible that the current source for UI_Minimal.cpp is
> sufficiently different from my board that I cannot rely upon the
> current source? (Change date shown by sourceforge is 2014-03-02)
> 
> My board: BoardVersion board V0.2 REV2; code 2014/Mar/23 18:16:08

I should really include the SVN revision number in the initial banner output to serial!   I’ve created a JIRA and will try to do it as soon as I have finished responding to this.

If we discuss it directly maybe we can move you to the main code version which will make it easier for me to fix things for you quickly.  Note that the current main version is set for a REV4 board and not running the main OpenTRV code, but I can show you how to fix that in your checked-out copy to help you tinker on the bleeding edge!

> 4. Any other advice about how to programmatically send a command to an
> OpenTRV board?

The CLI will go to sleep if you don’t use it for a while; you can get the board’s attention in a number of ways manually, or just wait until another ‘>’ is eventually produced.

> 
> 5. Are there instructions for flashing the board with new firmware, so
> I can receive data from my remote device, per discussion in May?

Yes, via the IDE or via avrdude.  Would you like to discuss that more here or off-line by email with me?

Rgds

Damon



More information about the OpenTRV-interest mailing list