Close

Finally everything is working

A project log for IoT Ethernet Sensor using Power over Ethernet

This solution has a number of unique benefits, a sensor platform with webserver, powered over Ethernet, accessible and programmed by browser

deandobdeandob 01/20/2015 at 21:480 Comments

It took a longer and was harder than expected but I have the basics working now. Discovered a couple of faults in the schematic which translated to the board (PORTA and PORTB are the only ports that can support enough current output to light the LED on the board) and I had the Ethernet bias resistor connected to Vcc when it should have been ground. After a bit of surgery with a knife blade (10 mil tracks are delicate to alter!) the electronics are working.

As expected, to get TCP/IP working on the chip wasn't going to be easy as the microchip TCP/IP stack library is complex and setup for their development boards. I'm also new to Microchip C and their IDE - the MPLAB IDE is quite nice, functional and easy to work with, however I'm convinced the integrated programming function is seriously broken as the PICKIT3 programmer isn't recognised but the standalone programmer works fine (lots of posts on the microchip forum about similar problems with the programmer). After about a day of hacking the library code I finally got the board to respond to ICMP pings and then to sockets calls. Didn't take long to modify my node.js home automation framework to support sockets and have the board communicating to node.js.

Now I need to look at what type of application layer protocol to use on top of sockets. It will either be COAP or MTTQ-SN, likely to be MTTQ-SN as the pub/sub topic structure will fit into the addressing scheme I use in the home automation framework (eg. weather/temperature/outdoor) and the framework is also message driven with a broker model very similar to the MTTQ broker so I might be able to write an emulation layer to act as the MTTQ broker. Also the MTTQ client is pretty lightweight so should fit on the remaining ROM on the chip.

Memory constraints on the chip is a concern, the TCP/IP library with sockets support takes up about 60% of the ROM and that is without a web server. I purchased the 64K ROM chip having previously managing to squeeze a lot of stuff in the older PIC chips within 2K I thought 64K will be plenty. However the lite version of the microchip compiler isn't very efficient and the TCP/IP library isn't small, so it looks like if I want to run up the web server and the tinybasic interpreter I will run out of room, so may need to switch to the 128K version. I also want to do basic audio/video for one of the applications I have earmarked for this platform, which won't be an easy task (video using the OV7670 FIFO module and audio using the PIC ADC and the PIC as a PWM DAC).

Discussions