Networking and Communications
This week was about networks and communicating between multiple devices where devices can be abstractly defined as wireless devices, tethered devices, or even communications between chips within one device or PCB. Whenever information needs to be communicated, there has to be some communication protocol. And sometimes, that communication needs to be propogated throughout many devices, which leads to a network.
Class this week talked a lot about communication and networking protocols and all the layers of information abstration gets built up in order to navigate through complecated networks. We talked about the different OSI Layers, but overall it was way too much information for me to digest at one time.
Two of the things I really took away were the physical media and modulation layers. These are something I don't think about at all and yet completely take for granted. I've actually done thought experiments about what it would be like to see light in spectrums other than the visible spectrum (such as radio or infrared etc). And all I can think of now is how blind I would be by all the signals that surround us. Those signals are created and propogated through some sort of physical media (or wirelessly), and all these signals can coexist because of differences in modulation techniques. This just blows my mind.
Starting Simple: Serial
Because I didn't have a terrible amount of time to explore this week, I chose to keep thigns simple and create the tethered bridge and nodes boards that Neil showed in class. After creating the schematic and board in EAGLE, I milled it on the roland and it came out like this:
I was able to get them talking to eachother via serial communication passing along the Tx and Rx lines from board to board along with a Vcc and GND line. I uploaded the code Neil has here and everything worked.
After reading through the code, I realized the code was simulating it's own serial type protocol by establishing a simple agreement of communication where messages would start with a start bit and then after a precise time, would communicate the bits of the message to be communicated. This is essentially simulating serial in software (is this bit-banging?).
What seemed incredible and suspicious was the bit delay time (value is 100ms). This delay time is inserted between successive writes to the Rx line and successive reads to the Tx line. The specific value of 100 (what has been 102 ms in previous scripts) was that the sum of these delays was supposed to perfectly correspond to a baud rate of 9600 so that my laptop could properly process the serial responses.
When using term.py, there would be times where the serial signal wouldn't come back properlly. I think I attribute this to the bit_delay perhaps not being completely perfect over time. In general, Neil's script did work. However, I tried modifying the srcript to call a function whenever a node's id was called. In this function, the node would send a the character of the previous node over serial (i.e. if I typed '2' on my computer, node with id 2 would receive it, flash, then send a '1' over serial and then flash again.) This way, I could hopefully see the message propogate backwards through the nodes back into the bridge. However, this not only didn't work, but I also stopped receiving proper serial messages back on my laptop term.py. The program was running, however, because the lights were blinking similarly to the first program.
I attribute this weird behavior to possibly screwing up the timing of the serial communication and perhaps need to probe around with the bit_delay until messages start showing up in my term.py. I might also add in a delay before a node sends out the character ide of the node previuos to it. I also found through testing Neil's script that if I pressed characters pretty quickly on my laptop, the nodes wouldn't be able to respond to all the character presses. Maybe I was hitting the limit of 9600 baud? I'm not quite sure.
Conclusion
Overall, good and reliable communication between devices is hard. There have been some good stardards established that makes much of our everyday communication fairly reliable, but most people take that for granted. I certainly want to explore more of the wireless communication devices (BLE and Wifi) at a later time.
Terminology
Serial, I2C, Synchronou and asynchronous communication, OSI Layers, wired and wireless, modulation, error correction and detection, networks
Technologies Used
EAGLE, Roland Mill, Serial Communication