Hacker News new | past | comments | ask | show | jobs | submit login

semi-related: a couple months ago I found a large industrial shipping scale in my parents basement. I grabbed an FTDI USB -> RS232 cable and a DB25 -> DB9 cable, plugged it into a Raspberry Pi, and hacked this together:

https://gist.github.com/sielickin/8cc79f0cb6a4b4c229b9786dff...

There are some nasty hacks in there and probably a few bugs that I could fix up at some point, but it works just fine!

I love how in a little more than 100 lines of Go code, I can so easily have a program with a dedicated thread to reading data from the serial port, a dedicated thread to serving up the initial http page to clients, a dedicated thread for sending data to websocket clients, and all of it works together so cleanly with messaging through channels.

I copy-pasted some d3.js code from around the web, retrofitted it, and in maybe 2 hours of work I have something pretty cool.

My Mom runs an ecommerce website and uses another scale for shipping, I wonder how hard it would be to write a driver for Windows that consumes data over the network and would interface with her shipping label software.




That's amazing - thanks for showing me that. I have much to learn that-a-way.


s/http page/html page/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: