Anna Aflalo

Fab Academy 2015 | Wgtn

WEEK 13 | Networking & Communications





This week Fab Lab Wgtn is making a digital Jargon-o-meter. For that purpose, we decided to build our "WellyNet" network.
Networking Class & Specifications

STEP 1: Brainstorm around the white board.
What are the specifications that all the different boards need to respect?
Which pin(s) do we use to communicate?
How do we organize the data in our programs?
How much power do we provide?, etc.
Here, you'll find our WellyNet Specifications file.

Super bonus: having Daniel to answer our questions and guiding us all week long.
SoftwareSerial library
The plan was to use the SoftwareSerial Library to make the network communicate. But this library requires one pin to receive and one pin to transmit data and our network is bigger than two boards. So we needed to use only one pin to receive and transmit data.

To solve that problem, Daniel found on GitHub the SoftwareSerialHalfDuplex library. From that library, he created WellyNet library on Github also.

Then, he hacked the WellyNet library in order to communicate as we decided:
- Header (3 bytes): destination, sender, message's length
- Message
Reference boards & terminal


Jasmin, Geoff, Craig and Ben worked on the terminal and the reference boards.

- The terminal provides power to Wellynet,
- The reference boards are made to test WellyNet library.

We needed to add a clock (20Mhz crystal) to the first version of the reference board. The internal clocks are not as accurate as the crystal so we had mistakes in the transmitted data.
High five button
When I was designing the board I had our specifications open at the same time.

First, we had to be careful with the power. The power provided to the board while we're programming it cannot be the same as the one provided by the network. Indeed, we cannot provide power through the 6 pin header while we use it to send the program. So I created a bridge from the FTDI cable (VCC1 on my schematic) to VCC. For that purpose, I used a 0Ω resistor. I'll need to take it off once my board is programmed.

We also saved the "SCK" line in case we want to tell the board to be "quiet" while another board is "talking".

Once my board was soldered, I couldn't burn the bootloader. I realized that my schematic was wrong. MISO was connected to MOSI and MOSI wasn't connected to anything. Good job Anna...
I had to take off copper and use wires to fix this mistake. I also soldered a resonator instead of a crystal. After all these modifications my board was finally working. Then I had to test my code with another WellyNet board but my board wasn't working anymore. So I redesigned the first on Eagle one and milled a new one:
With Daniel and Ben we used Arduino to test the WellyNet library on our boards. For that purposed, I programed my board and took off the 0Ω resistor (to provide power through the network). We decided to simulate the network with an Arduino Uno board. We faced some issues:
When we connected my board, power was going through but didn't receive the message expected: "I am 1". That meant that the board wasn't communicating. Daniel checked my program and it was okay. The reference boards which were working the day before weren't working anymore. So Daniel checked his WellyNet library code and he realised that his last modifications caused memory issues. Arduino has more memory than our board that is why our WellyNet programs were working with this board.

Daniel fixed the memory issue and my board was finally sending and transmitting data through WellyNet.
Once Ben, Craig and Jasmin also had working boards, we organised a programming session. The objective was to finalize our programs and agree on the codify messages.
When the "high five button" is pressed, the board will send to the network: "the destination: broadcast" + "its address: 1" + "the message: E".
Thanks to Daniel's example in the WellyNet library, my board was easy to program.
According to the library using "0x00" as a destination should address the message to the all network but we had some issues with this part. So we decided to send the "E" message to the destination "2" and we set up the address "2" on every board.

Click here to download the schematic, the board and the .png files.