Search found 121 matches

by MMliam
Tue Jul 26, 2022 1:59 pm
Forum: General Discussion and Questions
Topic: Convert Byte-String to Ascii-String -SOLVED
Replies: 8
Views: 13499

Re: Convert Byte-String to Ascii-String -SOLVED

I found this works... str(theByteString, 'utf-8') as well. Does the job of converting b'' string decoding. Maybe a good thing to avoid another import unless you really need it? The 'Jibun no kage' suggestion was to avoid importing "binascii"; your approach and mine require importing "binascii' for ...
by MMliam
Tue Jul 26, 2022 12:34 pm
Forum: General Discussion and Questions
Topic: Convert Byte-String to Ascii-String -SOLVED
Replies: 8
Views: 13499

Re: Convert Byte-String to Ascii-String -SOLVED

I tried it in PYTHON Idle & micropython. msg = b'4f6e' msg = str(msg, 'utf-8') print(msg) 4f6e It did not decode the byte stream to - On Tried: msg = b'4f6e' msg = str(msg, 'utf-8').decode('ascii') Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> msg = str(msg, 'utf-8').dec...
by MMliam
Mon Jul 25, 2022 5:39 pm
Forum: General Discussion and Questions
Topic: Convert Byte-String to Ascii-String -SOLVED
Replies: 8
Views: 13499

Re: Convert Byte-String to Ascii-String - SOLVED

Found the solution, to my own question :D

message=b'4f6e'
message=ubinascii.unhexlify(message).decode('ascii')
print(message)
On
by MMliam
Mon Jul 25, 2022 2:59 pm
Forum: General Discussion and Questions
Topic: Convert Byte-String to Ascii-String -SOLVED
Replies: 8
Views: 13499

Convert Byte-String to Ascii-String -SOLVED

Steps that convert a byte-string to an ascii-string: >>> print(Message) b'4f6e' >>> x=Message.decode('ascii') >>> print(x) 4f6e >>> y=ubinascii.unhexlify(x) >>> print(y) b'On' >>> z=y.decode('ascii') >>> print(z) On Is there a simpler, one step process to make the same conversion? In other words tur...
by MMliam
Sun Jul 24, 2022 4:41 pm
Forum: General Discussion and Questions
Topic: Need to convert UART received data.
Replies: 19
Views: 6140

Re: Need to convert UART received data.

Ok, I've seen those on Amazon: While I have these: https://www.amazon.com/dp/B08246MCL5?psc=1&ref=ppx_yo2ov_dt_b_product_details https://www.amazon.com/dp/B089F6LRBS?psc=1&ref=ppx_yo2ov_dt_b_product_details Antennas: https://www.amazon.com/dp/B09K3ZPY5Z?psc=1&ref=ppx_yo2ov_dt_b_product_details I've ...
by MMliam
Sun Jul 24, 2022 2:35 pm
Forum: General Discussion and Questions
Topic: Need to convert UART received data.
Replies: 19
Views: 6140

Re: Need to convert UART received data.

Just ran a test on the 38 pin modules; they essentially have the same issue on the default pins. There is a slight difference; after a send, garbage is received first, the receiver loops around and gets the correct data on the second read; weird. Like the 30pin units, the 38 pin versions work well a...
by MMliam
Sun Jul 24, 2022 12:36 pm
Forum: General Discussion and Questions
Topic: Need to convert UART received data.
Replies: 19
Views: 6140

Re: Need to convert UART received data.

The WROOM come in different pin amounts, the most common seem to be the 30 or 38. You are not the only one to mention problems using the default pins, but most comments seem to believe there may be some conflict with the flash-memory. I'm wondering if the problems have something to do with the circu...
by MMliam
Sat Jul 23, 2022 10:41 pm
Forum: General Discussion and Questions
Topic: Need to convert UART received data.
Replies: 19
Views: 6140

Re: Need to convert UART received data.

Hi Robert, Hallelujah! I tighten-up the grounds, and that helped a little more; BUT, what worked was pin re-mapping. Re-mapped rx=5 & tx=18, and I'm running at 115200b/s. I also went back to my original breadboard. Now I can finally get on with making a gateway for my project. It's a pity micropytho...
by MMliam
Sat Jul 23, 2022 8:39 pm
Forum: General Discussion and Questions
Topic: Need to convert UART received data.
Replies: 19
Views: 6140

Re: Need to convert UART received data.

Looks like great minds think alike; I'm beginning to suspect the breadboard. I even tried another ESP32 for the sender; same results. Initially I was controlling both ESP32's with two instances of Thonny running on the same PC. I ran a test using two PC's; same result. Today I just received two brea...
by MMliam
Sat Jul 23, 2022 7:48 pm
Forum: General Discussion and Questions
Topic: Need to convert UART received data.
Replies: 19
Views: 6140

Re: Need to convert UART received data.

Another curious thing, is that if I run the complete receive code (no manual REPL) I never get the complete data, in other words I never see the "Hello\r\n" at the end. I only get that if I manually execute the uart.read() in REPL. There seems to be some sort of timing issue also. I just tried an ex...