Dave here, tech geek among other things.

Arduino Parsing HTTP GETs

Posted by: on Dec 15, 2013 | No Comments

Adding new switches and controlling the switches that are saved is done through some http magic. By using some GET commands. This is an idea how I use the arduino to parse the HTTP GET requests.

A bit troublesome to parse all of it. But I found a great snippet over at arduino forum.


// Function to return a substring defined by a delimiter at an index
char* subStr (char* str, int index) {
char *act, *sub, *ptr;
static char copy[MAX_STRING_LEN];
int i;

// Since strtok consumes the first arg, make a copy
strcpy(copy, str);

for (i = 1, act = copy; i <= index; i++, act = NULL) {
//Serial.print(".");
sub = strtok_r(act, delim, &ptr);
if (sub == NULL) break;
}
return sub;

}

Idea I had was to call a HTTP GET with the following code.
/add=namn&deviceid=A&devicechannel=3&status=0
In order to create a device with the name "namn", having the device id A, device channel 3 and starting with the status 0. Status will changed when controlled. Device id and channel depends on the RF receiver.

Första kväll med lite ny utrustning

Första kväll med lite ny utrustning

Posted by: on Dec 5, 2012 | No Comments

Har precis införskaffat mig lite ny utrustning till kameran, nämligen ett objektiv och ett stativ. Stativet i fråga är ett kit från Manfrotto, och objektivet blev ett . Så så fort posten kom förbi med objektivet blev det att klä på sig varmt och gå ut! Det som fick följa med var mitt Canon 17-55 , det nya stativet och givetvis 70-200.

17-55, första bilden med stativet

70-200

Brosundet

17-55

Brosundet

Fyr, hoho

Båt taget från Fjellstua med 70-22

17-55

Nexus 7 minirecension (Uppdaterad)

Nexus 7 minirecension (Uppdaterad)

Posted by: on Jul 7, 2012 | 9 Comments


Blev tilldelad en Nexus 7 av Google under Google I/O förra veckan och har senaste veckan använt den flitigt tillsammans med ex ADKn som jag skrev om i ett annat inlägg.

För att få lite perspektiv och information så är jag också ägaren av en Galaxy 10.1 och även en Xoom. Så jag har använt större tablets.

Bug in eclipse with latest ADT?

Posted by: on Jul 6, 2012 | 3 Comments

So, last night I updated to the latest ADT version. Which was 20.0.0.v201206242043-391819. The new updates that were presented at I/O rocks, helping out with fragments in the first activity and icons. That is just awesome. But there is just one little problem, it doesn’t seem to work.

I have the latest support library installed (Revision 9).

Google I/O Wrap Up

Google I/O Wrap Up

Posted by: on Jul 6, 2012 | No Comments

I didn’t have time to write as much as I wanted. Since I am a developer I went to listen to the different sessions and loads of different media was there too. But here are some thoughts and a couple of pictures of some of the things I did last week. Read the full article to see the pictures.

Google IO 2012 (Day 1)

Google IO 2012 (Day 1)

Posted by: on Jun 29, 2012 | No Comments

Right, Google I/O 2012 started of yesterday.
And these are some of the views and thoughts from the first day. Read the complete post in order to see all pictures!

Raspberry Pi Lego case

Posted by: on Jun 3, 2012 | No Comments

Yet another Raspberry Pi lego case!

So, after picking up the raspberry pi I wanted to have some kind of casing for it. I have some other plans too that I will publish later on, some which I am working. But those will take some more time. So I felt that I better have a good case now, heck. At least a case.

Raspberry Pi

Posted by: on May 30, 2012 | No Comments

Not sure if you have heard about it. But it’s a great little computer and the demand is huge for it. The community is growing by the second, take a look at http://www.raspberrypi.org/

The pi is quite picky when it comes to peripherals, one example is keyboards. I have tested 5 different keyboards and only 3 of them worked. Unfortunately my lovely wired Apple keyboard does not work. According to some tests it’s due to the power consumption of the keyboard. I bought an external powered USB hub, a Belkin 7  port. The USB Hub did not work with the Pi. It instead killed the Ethernet of the device, however the keyboard did work.

So I returned the USB hub and bought a new one, a 4 port Noname (Deltaco) from Dustin and the one I got was flawed, so RMA on that one. My Deltaco keyboard does however work without external power, so I can finally use it at home! Yay

At the moment it runs Debian squeeze with Heezer’s rpi-updater which is an awesome firmware updater for Arch Linux and Debian.

 

My Arduino project

Posted by: on May 30, 2012 | No Comments

This post got somewhat lost when I transisted to the new server hosting and new theme. So I will just draw it up quite rough.

My Arduino project is a home automation project involving and Arduino Mega 2560, WiFly Ethernet Shields. A bunch of One-Wire temperature sensors. IR transmitter and receiver alongside RF transmitter and receiver.

The RF transmitter is supposed to communicate with my Nexa remote-controlled outlet switches and also my dimmer which is yet to be installed. This actually works at the moment quite beautifully. Thanks to some libraries out there for the RF transmitter.

Temperature sensors works as well, the plan is to have a couple around the house and also a couple outside and get an average temperature for outside and inside.

IR is supposed to control my sound system, Xbox and television.

More to come, definitely more detailed and also pictures.

New new blog

Posted by: on May 30, 2012 | No Comments

Since the hosting was changed the blog also disappeared. Rather than fiddling with the backups I decided to restart from scratch.

So the blog will host some tech stuff from time to time. As I develop Android applications and also have my Arduino project I planned to write about (home automation stuff) as well as some different projects with the Raspberry Pi I recently got.