Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platformio+Digispark compatible solution #31

Open
dontsovcmc opened this issue Nov 20, 2017 · 1 comment
Open

Platformio+Digispark compatible solution #31

dontsovcmc opened this issue Nov 20, 2017 · 1 comment

Comments

@dontsovcmc
Copy link

dontsovcmc commented Nov 20, 2017

I want to use CmdMessenger with Digispark attiny85.

They have their own Stream class, Print classes.. .

  1. First of all I add some functions to Stream class.
int timedRead()
virtual size_t readBytes(char *buffer, size_t length)
  1. I spend a lot of time to find a problem why CmdMessenger can't hear me (only UnknownCommand handler called) ... (I connect Arduino to COM port and want to send-receive bytes in Terminal)

I was angry when I found solution:

Send command 0 
30 3B
Receive command 1
01 2C 33 3B

Digispark made print function without default argument=DEC... for all types except char..
For compatible we should add DEC everywhere in CmdMessenger :(.

comms->print(cmdId, DEC);

and etc

  1. Attiny85 doesn't want to start with CmdMessenger cause little memory.
    I change defines:
#define MAXCALLBACKS        5   // The maximum number of commands   (default: 50) 
#define MESSENGERBUFFERSIZE 20   // The length of the commandbuffer  (default: 64)
#define MAXSTREAMBUFFERSIZE 20  // The length of the streambuffer   (default: 64)

and it works fine :)

There was difficult to find solutions cause:

  1. There is no protocol description or trace. Please add them.
  2. There is no tests written on "C" or "Python" :)
@dontsovcmc dontsovcmc changed the title Bad protocol design (0x30 byte means command 0) Please, add trace to examples Nov 20, 2017
@dontsovcmc dontsovcmc changed the title Please, add trace to examples Digispark compatible solution Nov 20, 2017
@dontsovcmc dontsovcmc changed the title Digispark compatible solution Platformio+Digispark compatible solution Nov 22, 2017
@dontsovcmc
Copy link
Author

There are errors in Platformio libraries for "digispark-tiny" platform :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant