Skip to content

Commit

Permalink
deleted old arduino files and added some text to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rofthedeep committed May 9, 2015
1 parent 8411048 commit 449fbcd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 88 deletions.
35 changes: 27 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ the [php_serial.class.php](http://code.google.com/p/php-serial/) is used.

Why another solution? I didn't get the other work :-)

What can be done?

With the first version its possible to send different values with one command.
So, you can take your light on and of, or even dimm it.

## Install

### Webserver
Expand All @@ -18,20 +23,34 @@ For Rasperry Pi look at this tutorial http://www.raspberrypi.org/documentation/r
Clone the repository in your htdocs folder an try to open it. For example with http://localhost/homerrr/.

### set permissions for serial
To allow access to the serial port of your device, you have to chmod 777 the driver for the serial.
To allow access to the serial port of your device, you have to chmod 777 the driver for the serial. You can
find the right serial port with the arduino ide. At the bottom right is written to which
port your arduino is connected. In my case it was "/dev/cu.usbmodem1421" for mac and "/dev/ttyACMO" for my raspery.
This connection must be set in the "initSerial.php" file in $serial->deviceSet. Look at the examples there.

### Push code on the arduino
Use the arduino software to push the code (arduino/arduino_homerrr/arduino_homerrr.ino) on the arduino.

### Serial Monitor or disable reset of arduino
Open the arduino serial monitor - otherwise sending won't have any effect. Other solution: Put a 100 Ohm resistor between the 5v and the reset pin of the arduino.

## Inspiration and Thanks!
This Project is heavily inspired by a few other projects:
heimcontrol.js - http://ni-c.github.io/heimcontrol.js/ - i wanted to have something like this that I understand
arduinoPi - https://github.com/JanStevens/ArduinoPi-Controller - here I understood the working of the php_serial.class - thanks a lot!

Open the arduino serial monitor - otherwise sending won't have any effect.
Another solution: Put a 100 Ohm resistor between the 5v and the reset pin of
the arduino to disable the autoreset.
And the solution that worked best for me: put a 100qf transistor between the RESET and the GND Pin.
Or google "disable arduino reset".

### Tricky things
- It took me a lot of time to find a working baud rate and a working arduino code. The best working baud rate for me is 9600.
- Another important thing: After opening the serial connection in the initSerial.php file, a "usleep(200000);" is the best solution,
that the serial connection is realy open and no data is send too early.
- add a while (!Serial); to your arduino setup code. This is the second solution, which works fine with the usleep. So nearly every
signal goes through.

### keep your raspery connected to the internet

The Frontend need some google fonts and jquery. If you don't have an internet connection, comment the js files and
the google font files out.

## Inspiration and Thanks!
This Project is heavily inspired by a few other projects:
heimcontrol.js - http://ni-c.github.io/heimcontrol.js/ - i wanted to have something like this that I understand
arduinoPi - https://github.com/JanStevens/ArduinoPi-Controller - here I understood the working of the php_serial.class - thanks a lot!
50 changes: 0 additions & 50 deletions arduino/arduino_homerrr/arduino_homerrr.ino

This file was deleted.

29 changes: 0 additions & 29 deletions arduino/sketch_feb27a/sketch_feb27a.ino

This file was deleted.

3 changes: 2 additions & 1 deletion initSerial.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
// for mac
$serial->deviceSet("/dev/cu.usbmodem1421");
// for rasperry
$serial->deviceSet("/dev/ttyACMO");
//$serial->deviceSet("/dev/ttyACMO");
$serial->confBaudRate(9600);
$serial->deviceOpen();
// add the sleep to wait until the connection is realy open
usleep(200000);
$pin = $_GET['pin'];
$value = $_GET['value'];
Expand Down

0 comments on commit 449fbcd

Please sign in to comment.