Search found 31 matches

by cgglzpy
Sat Feb 15, 2020 5:49 pm
Forum: General Discussion and Questions
Topic: Remove and Replace Printed characters in serial terminal
Replies: 5
Views: 92

Re: Remove and Replace Printed characters in serial terminal

I don't know if this is the same, but using '\r' and "print(msg, end=' ')" should work. e.g. >> def print_and_clear(msg): ... msg_list = ['This', 'is', 'a', 'message', 'that', 'replaces', 'itself'] ... print(msg, end='') ... time.sleep(1) ... print('\r'+' '*len(msg), end='\r') # This clears previous...
by cgglzpy
Fri Feb 14, 2020 6:08 pm
Forum: ESP32 boards
Topic: socket ssl
Replies: 1
Views: 43

Re: socket ssl

Hi, ke528

Look at this issue in MicroPython repo: https://github.com/micropython/micropython/issues/5543

MicroPython v1.12 stable release should work, so rolling back to last stable version resolves the issue.
by cgglzpy
Thu Feb 06, 2020 3:58 pm
Forum: ESP32 boards
Topic: ADXL345 range setting on micropython
Replies: 3
Views: 124

Re: ADXL345 range setting on micropython

i've insert the suggested lines in the code but nothing happens. Hmm, maybe because of this From the data sheet Page 26 : All data, except that for the ±16 g range, must be clipped to avoid rollover So I think you have to comment or erase the "if x > 32767" lines. Something like this: def xValue(se...
by cgglzpy
Tue Feb 04, 2020 6:38 pm
Forum: ESP32 boards
Topic: ADXL345 range setting on micropython
Replies: 3
Views: 124

Re: ADXL345 range setting on micropython

Hi, You can see this in the data sheet: ADXL345 [Page 26-27] Register 0x31—DATA_FORMAT (Read/Write) --> Range Bits D1-D0 So you need to write to register 0x31 the byte 0x03 which is 0b00000011 (see Table 21) setting bits D1-D0 to 1. In code should be something like: reg_DATA_FORMAT = const(0x31) and...
by cgglzpy
Fri Jan 17, 2020 4:56 pm
Forum: Development of MicroPython
Topic: Tree command for upysh
Replies: 8
Views: 443

Re: Tree command for upysh

Hi, I made a 'display disk usage statistics' / 'du' command too, in case anyone is interested... It's like 'ls' command but size is in 'Human-readable' output, by default do not list hidden files/dirs, it prints also size of dirs and it has an option for the depth level (default 0) e.g. >>> du 8.3 K...
by cgglzpy
Fri Jan 17, 2020 3:33 pm
Forum: General Discussion and Questions
Topic: How to run an mqtt-repl?
Replies: 21
Views: 1147

Re: How to run an mqtt-repl?

That looks good! :) That looks really helpful! I have a couple of questions: - why do you first try to eval and then exec? why not eval(compile(self.rec_msg)) ? - why do you call gc.collect() when there is no output? As I said it was experimental (aka "I have the ideas but I don't know how to implem...
by cgglzpy
Thu Jan 16, 2020 10:09 pm
Forum: General Discussion and Questions
Topic: How to run an mqtt-repl?
Replies: 21
Views: 1147

Re: How to run an mqtt-repl?

Hmm, I see... About #1 In that case you may want to have a look at some experimental work I did before the ssl repl : upysecrets.py I think that the 'CRYPTOGRAPHER' class method 'crepl' can be adapted to work with MQTT with some changes (ignoring the decryption/encryption steps and instead of return...
by cgglzpy
Thu Jan 16, 2020 7:49 pm
Forum: General Discussion and Questions
Topic: How to run an mqtt-repl?
Replies: 21
Views: 1147

Re: How to run an mqtt-repl?

I'm trying to write an MQTT Repl that accepts input by subscribing to a topic (the message payload is simply repl input) and that writes output to another topic (again, the message payload is simply repl output) This would be a very nice one to have :) I don't know about the uasyncio part, but to m...
by cgglzpy
Thu Jan 16, 2020 7:22 pm
Forum: General Discussion and Questions
Topic: Partial mac address ?
Replies: 4
Views: 232

Re: Partial mac address ?

Hi, just mention that MicroPython introduced a separator option for binascii.hexlify function which is quite nice for this case: >>> from binascii import hexlify >>> hexlify(b'$b\xab\xd4\xce\xe8', ':') b'24:62:ab:d4:ce:e8' Or >>> hexlify(b'$b\xab\xd4\xce\xe8', ':').decode() '24:62:ab:d4:ce:e8' In ca...
by cgglzpy
Mon Jan 13, 2020 3:34 pm
Forum: Programs, Libraries and Tools
Topic: SSL(Web)REPL + SHELL
Replies: 2
Views: 287

Re: SSL(Web)REPL + SHELL

Hi, thanks I forgot to mention that file transfer (get/put commands) are also done over SSL and SHELL / REPL comes with all sort of autocompletions :) This looks very promising! I'm tired of all the insecure protocols everywhere... Thanks for sharing! I don't know if this is "secure" or not, but I g...