Posts | Comments

Planet Arduino

Archive for the ‘Network Hacks’ Category

It used to be that Web browsing was simple. You asked a server for some text, which was duly sent, and then formatted by your browser. Now a web page is as likely to be a full-blown application that is reading mail, editing text, or lots of other things and may use WebSockets to create a back channel to the server. Thanks to affordable hardware like the ESP8266 one of those things a modern web browser can do is sense and control the real world. [Acrobotic] has an interesting video about using WebSockets to allow a browser to talk to an ESP8266 web server in real time. You can see his simple demo in the video below.

Of course, you’ll use the usual language you use on the ESP8266 — [Acrobotic] uses C++ in the Arduino IDE. On the browser side you’ll use JavaScript, although that will be embedded in your C++ program which acts as a web server.

It’s as well to remember that there are several other ways you could do this. You could, for example ask for a different URL, or pass data in a query string. The problem here is that the performance would suffer as you have to establish a new connection every time. you want to transact with the server. You could also use AJAX methods but they are not as efficient either since they are primarily aimed at updating a portion of a web page dynamically. The web socket is simple enough and as you can see in the video, the performance is quite good. It also facilitates non-browser based clients that use the same service.

We’ve seen this technique used to fly a quadcopter. WebSockets have been around for a while, so your browser should support them. If it doesn’t, though, you can always use this hack — at least in one direction.

In the old days, a serial port often connected to an acoustic coupler that gripped a phone handset and allowed a remote connection to a far away serial port (via another phone and acoustic coupler) at a blistering 300 baud or less. The acoustic coupler would do the job of converting serial data to audio and reconstituting it after its trip through the phone lines. Modems advanced, but have mostly given way to DSL, Cable, Fiber, and other high speed networking options.

In a decidedly retro move, [James Halliday] and [jerky] put a modern spin on that old idea. They used the webaudio API to send serial data to a remote Arduino. The hack uses a FET, a capacitor, and a few resistors. They didn’t quite build a real modem with the audio. Instead, they basically spoof the audio port into sending serial data and recover it with the external circuitry. They also only implement serial sending (so the Arduino receives) so far, although they mention the next step would be to build the other side of the connection.

They say the data transmission is finicky, but it works (see the video below). We imagine using proper modem tones and decoders might work better, but would be a lot more effort. We’ve covered a 1200 baud modem before. We’ve also covered a bit of the theory behind them.

Filed under: Arduino Hacks, Network Hacks

Network switches come in two different flavors: managed, where you have some interface to configure and monitor the equipment, and unmanaged where the device just does what it is supposed to do and you can’t really control it. [Tiziano Bacocco] wanted to manage his cheap unmanaged switch, so he did what any good hacker would do: he opened it up.

Inside the Digicom 10/100 switch he found an IP178CH controller IC and a quick search turned up a data sheet. [Tiziano] noticed there were three ways to configure the switch: Some hardware pins could control very basic functions; an EEPROM (absent on the PCB) could configure the device; or the chip would accept commands via a synchronous serial port.

Since the datasheet covered the protocol required, [Tiziano] commandeered an Arduino Pro Mini and used it to send commands to configure the switch. A few resistors and some quick code allowed him to control VLAN and other functions on the switch via the USB port. Of course, he mentioned you could use a Raspberry Pi if you wanted a network interface–or maybe that’s a good excuse to use one of those Ethernet shields you got on clearance at Radio Shack.

If you aren’t clear on why you care about a managed switch, see the video below. Of course, your switch might not use an IP178CH, but we’ve covered a similar hack for a TL-SG1005D chip before, too.

Filed under: Arduino Hacks, Network Hacks

Many people have their home network setup with a dynamic dns service in order to remote access their files, printers, or Pi based security camera systems. Many people also suffer from less than stellar internet connectivity and find themselves unable to access their home system due to a stalled signal.

netBOOT is an Arduino based device that automatically resets your modem for you, when you are unable to. Core of the system is a standard issue ATMEGA328p based Arduino board combined with a W5100 Ethernet module, and a relay module. The software on the Arduino periodically pings a list of IP addresses and listens for a response. If none is found within 3 tries the relay module, which is connected inline with the DC power of your modem, is clicked open for 10 seconds and then returned closed. Once your modem has rebooted and re-synced everything should be good to go.

We don’t remember seeing this feature in the list of specs for Google’s new OnHub. The ability to reset bad connections seems like a feature that should be built into future-thinking routers, right?

The 2015 Hackaday Prize is sponsored by:

Filed under: Arduino Hacks, internet hacks, Network Hacks

  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook