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

Script #27

Closed
msillano opened this issue Feb 9, 2018 · 5 comments
Closed

Script #27

msillano opened this issue Feb 9, 2018 · 5 comments

Comments

@msillano
Copy link

msillano commented Feb 9, 2018

Testing scripts I found a unespected behaviour:
This is accepted:

       publish remote $status_topic "{Time:" | $timestamp | ",TOGGLE}"  retained

But this not:

       publish remote $status_topic | "/user" "{Time:" | $timestamp | ",ON}" retained

With the message:
Error (action command expected) at >>"/user "{Time: | $timestamp | ",ON} retained publish
P.S.
I seen the BNF_: <topic_id> < exp r >, so <topic_id> can't be an expression. OK

One more note:
for a better utilization of 4000 script bytes, maybe it is possible to:

  • trim() any line before storage
  • reduce any comment line to only starting '%' (so the line numbers are respected) before storage

Best regards
Marco

@martin-ger
Copy link
Owner

You are right, for the topic_id I currently do not full expression parsing. A variable instead of a constant works, so it can be dynamic. I could change that in the next future, not too much lines required.

Compression during load would work as well, but it would already require basic parsing before writing to to memory and "show script" would show something more obfuscated. When reading it from flash into RAM for interpretation I already compress it in the way you suggest.

Do you run into problems with script size? 4KB is somewhat arbitrary. Could increase that...

@jnherm
Copy link

jnherm commented Feb 17, 2018

May I know what language is the script you are using Martin? THanks!

@msillano
Copy link
Author

It is an 'ad hoc' Martin's script language, not similar to any other.
For documentation see https://github.com/martin-ger/esp_mqtt/blob/master/SCRIPTING.md.
Regards

@jnherm
Copy link

jnherm commented Feb 18, 2018

Thank you @msillano !

@martin-ger
Copy link
Owner

If you need more freedom for programming, I would recommend the Arduino version: https://github.com/martin-ger/uMQTTBroker where you can write the application completely in C++.

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

3 participants