The homepage for this project has moved:
Check out the new site at:
http://ardomotic.com/
The new version contains many of the features described in the home page and many others.
Check out the new site at:
http://ardomotic.com/
The new version contains many of the features described in the home page and many others.
Running the code the first time
For a first test to see if the code is working properly, it's only necessary to have an Arduino Ethernet (or normal Arduino with Ethernet shield).
First of all, remember Ardomotic was developed on Arduino IDE 022. The current version will NOT work on 1.0.
The only things should be necessary to change before a first test are the lines:
static uint8_t mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x75, 0x57 };
static uint8_t ip[] = { 192, 168, 1, 69 };
#define SYSTEM_PASSWORD "bananas"
where you should fill in your arduino MAC Address, preferred IP and system password.
This should be enough to get things going... Using a browser you can now connect to the Arduino. To connect to the Arduino write the address "HTTP://192.168.1.69" in the browser address bar.
This should open the login page (with a broken link on the image). Writting the system password should take you to the main pages, where once again all the images will be missing, but will be possible to recognize the structure of each page.
Now to turn something on and off... The device named "Pantry Light" is assigned to the pin 8 on the Arduino, so connecting a LED with a resistor to that pin is enough to test it. Clicking on the broken image next to the "Pantry Light" name should turn that LED on and off.
The following two lines should be commented the first time ardomotic runs:
// loadDevicePositions();
// loadSchedules();
They should be commented because reading configuration data that was not initialized could crash the system. To initialize the memory, simply press the Save button on the Scheduler, and press the Reset Positions button on the blueprint view. After these two steps it's safe to uncomment the code.
First of all, remember Ardomotic was developed on Arduino IDE 022. The current version will NOT work on 1.0.
The only things should be necessary to change before a first test are the lines:
static uint8_t mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x75, 0x57 };
static uint8_t ip[] = { 192, 168, 1, 69 };
#define SYSTEM_PASSWORD "bananas"
where you should fill in your arduino MAC Address, preferred IP and system password.
This should be enough to get things going... Using a browser you can now connect to the Arduino. To connect to the Arduino write the address "HTTP://192.168.1.69" in the browser address bar.
This should open the login page (with a broken link on the image). Writting the system password should take you to the main pages, where once again all the images will be missing, but will be possible to recognize the structure of each page.
Now to turn something on and off... The device named "Pantry Light" is assigned to the pin 8 on the Arduino, so connecting a LED with a resistor to that pin is enough to test it. Clicking on the broken image next to the "Pantry Light" name should turn that LED on and off.
The following two lines should be commented the first time ardomotic runs:
// loadDevicePositions();
// loadSchedules();
They should be commented because reading configuration data that was not initialized could crash the system. To initialize the memory, simply press the Save button on the Scheduler, and press the Reset Positions button on the blueprint view. After these two steps it's safe to uncomment the code.
Getting the images to work
Assuming everything is working fine so far, it's time to get the images working. If they are hosted on a external server, just uncomment the line:
// SPRINT(strImgUrl, "http://my.image.site.com/mydirectory/");
and replace the address with the site where your images are hosted.
On the other hand, if they are going to be hosted by the Arduino and stored on EEPROMS as I did originally, it is necessary to copy the files first. I created 2 programs that can be found on the Software page. One is for Processing, it reads the files from the computer and sends them through the COM port, the other one is for Arduino, and it reads the files from the COM and saves them on the EEPROM. It also reads the files again from the EEPROM and calculates a CRC to make sure no errors have occured.
So for this to work you will need to upload the flasher code to an Arduino connected do the eeprom (this part does not require an Arduino with ethernet). Then open the matching Processing sketch, and update the line:
final String serialPort = "COM4";
with the port you want to use. Run the sketch and the program should start to listen for a signal from the Arduino. Then press reset on the Arduino, and the copy process should start. It will take a few seconds, and for each file that is copied, lines like this should be appearing:
File sent, CRC: 8A
File received, CRC:8A
Used Memory:45160
-> File loaded:confirm_30.gif
-> File size sent:1170
File size received:1170
File size written::1170
The values on the first two lines and the three last lines should always match. If they don't, something went wrong, most likely the EEPROMs aren't propperly connected.
If all the images were propperly copied, upload the Ardomotic core files once again to the Arduino and the pages should now appear complete.
// SPRINT(strImgUrl, "http://my.image.site.com/mydirectory/");
and replace the address with the site where your images are hosted.
On the other hand, if they are going to be hosted by the Arduino and stored on EEPROMS as I did originally, it is necessary to copy the files first. I created 2 programs that can be found on the Software page. One is for Processing, it reads the files from the computer and sends them through the COM port, the other one is for Arduino, and it reads the files from the COM and saves them on the EEPROM. It also reads the files again from the EEPROM and calculates a CRC to make sure no errors have occured.
So for this to work you will need to upload the flasher code to an Arduino connected do the eeprom (this part does not require an Arduino with ethernet). Then open the matching Processing sketch, and update the line:
final String serialPort = "COM4";
with the port you want to use. Run the sketch and the program should start to listen for a signal from the Arduino. Then press reset on the Arduino, and the copy process should start. It will take a few seconds, and for each file that is copied, lines like this should be appearing:
File sent, CRC: 8A
File received, CRC:8A
Used Memory:45160
-> File loaded:confirm_30.gif
-> File size sent:1170
File size received:1170
File size written::1170
The values on the first two lines and the three last lines should always match. If they don't, something went wrong, most likely the EEPROMs aren't propperly connected.
If all the images were propperly copied, upload the Ardomotic core files once again to the Arduino and the pages should now appear complete.
Setting my own Devices
At this point it's time to think exactly what devices are going to be controlled by the Arduino and how the communication will be made. If the devices can be connected through a wire to the Arduino, things should be really simple based on the given examples