Close

Burning the midnight oil.

A project log for Chirppp, Serial over LORA

Use LORA via GPIO and a full-duplex serial emulator for serial a connection intended for extended range use.

dominic-demarcoDominic DeMarco 07/01/2017 at 04:250 Comments

It was a late one tonight.

I finished up the code to send configuration strings to the radio and went to test it out, but was having some trouble. I was getting the response I was expecting from the radio from a serial console attached to a USB-RS232 dongle I had wired up in line between the C.H.I.P. and the radio, but I wasn't getting a response from the radio when I sent what looked like the EXACT same data from the C.H.I.P. to the radio itself... I was stumped for a while.

As it turns out I should've done a little more research, and UART isn't as simple as writing some characters to the /dev/ttyS0 device. There's framing that goes on in the background. The USB-RS232 dongle was taking care of it for me, so I never actually saw the frames in the hex data I was looking at on my development computer.

Lesson learned...

I spent the rest of the night tracking down a usable library for rust that would take care of all the protocol details for me. I found one that would work for my purposes but I was having an immense amount of trouble getting the Rust crate to be recognized.

It took a helpful user on the Rust discord channel to help me find out that it was a bug in the serial library I had chosen. The dependency for the mipsel target (my Vocore) was missing, so it seemed like the library was invisible to the code that needed to make use of it.

After fiddling with a local copy of the library I managed to add the line I needed and told Rust to "replace" that library with my local copy.

After all that work I got the message I was looking for:

Finished dev [unoptimized + debuginfo] target(s) in 12.15 secs
An errorless compile...

Now that I've seen that I'll be able to close my eyes and actually be able to sleep.

I'm hoping to get a PROPERLY framed UART packet sent to the radio from rust within the next day or two.

But for now, some much needed sleep.

Discussions