Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Program Halting after 24 hours on: May 04, 2013, 05:05:31 pm
Solved:

it was the ramp up/down a friend of mine who codes for a living redid a vast portion of the code.  This has solved the crashing when the program ramps and ramps down the LEDS!!

Thanks for your help everyone!

-Eilelwen
2  Using Arduino / Programming Questions / Re: Program Halting after 24 hours on: May 02, 2013, 04:14:50 pm
Quick update, I'll edit this as I get more information:

I just ran a speed test and it failed as soon as the lights started to come on.  so now at least I have a starting point!

Had to change the python code a bit, this reads it but its very messy.

Update so watching the speed test and something interesting happened, It didn't crash but it sure bogged way down.  I went from a minute being 1 second to 24 seconds.  This all happened when I hit the ramp up/down code.  it would appear I may want to simplify that code.

Code:
#!/usr/bin/python
import time
import serial

ser = serial.Serial(3, 9600)
time.sleep(2)

while True:
localtime = time.asctime( time.localtime(time.time()) )
logfile = open("D:\log.txt", "a")
ard = str(ser.read(100))
logfile.write(localtime)
logfile.write(ard)
logfile.write("\n")
line = ser.read(100)
print(line)
3  Using Arduino / Programming Questions / Re: Program Halting after 24 hours on: May 01, 2013, 02:16:49 pm
Ok I think this will do what I want.  I'll give it a go later and get back to you guys.  Thanks for your help so far!

Code:
#!/usr/bin/python
import time;
import serial;

localtime = time.asctime( time.localtime(time.time()) )

ser = serial.Serial("COM1", 9600)

while True:
if(ser.isClosed()):
break
try:
# This tries to open an existing file but creates a new file if necessary.
logfile = open("c:\log.txt", "a")
try:
str = ser.readline()
logfile.write(localtime)
logfile.write(str)
finally:
logfile.close()
except IOError:
pass
4  Using Arduino / Programming Questions / Re: Program Halting after 24 hours on: May 01, 2013, 11:15:08 am
Quote
Perhaps you could write a small program on your Laptop (using Python or Ruby, for example) that collects the Serial.print messages and saves them to a text file along with Laptop generated time-stamps. If you can leave the laptop running for a day or two you may get some useful data that would be too tedious to collect manually.

You could then search through the text file with a text editor to find the interesting bits.

...R

I'm afraid this is beyond my abilities, I wouldn't even know where to begin on that smiley-sad

However I will do some googling it seems there is already an article on it so I'll see what I can come up with smiley

-Danny
5  Using Arduino / Programming Questions / Re: Program Halting after 24 hours on: May 01, 2013, 10:07:13 am
Well

Code:
total = ((double)end_time) - start;

End time should almost always be around 8 or 9pm PST.

However if suncalc failed to run properly it could give a 0 end time.

Unfortunately I only have the 1 arduino and to make everything even more interesting I don't live at the same house as this arduino as I'm in the process of moving. 

I'll make a trip out tonight and see what information I can gather.

I do have an extra laptop I can leave plugged in however with a serial print.  I'll take it with me and see what I can get from it.
6  Using Arduino / Programming Questions / Re: Program Halting after 24 hours on: May 01, 2013, 08:53:56 am
Alright I'll give these a try!

on the 1st one as this is all connected now, would it be too complicated to have it still turn the lights on/off no ramp nothing fancy just on at a time off at a time, and increment a number on the LCD?  Problem I'm having right now is my old lights are bad and I until I get some Coral recovery using the arduino to just blink an LED isn't an option atm when it is I can do that for sure!!

2nd one easy I'll do this next time I'm sitting next to the Arduino!

Thanks.  I will let you know the results
-Eilelwen
7  Using Arduino / Programming Questions / Program Halting after 24 hours on: April 30, 2013, 10:47:32 pm
Greetings,

So I have a aquarium(oh yes another one), and I'm using an Arduino Mega to turn on the lights and other functions however this software just does the lights as the program is halting and is no longer responding as expected.

What I want the code to do and what works at least for a 24 hours period turn the lights on and off based off the sun positions IE sunrise twilight, sunrise, sunset and sunset twilight.  I did this with suncalc() and is my code.  The other thing it does is Ramp UP/Down based on a curve, this part was not programmed by myself I asked a friend that has programming experience for help.  I tied a potentiometer to the ramp up/down to control intensity.  You can fry corals by turning the LEDS on full blast!

What happens If I turn the arduino on in the morning it runs fine though out the day turns on ramps up ramps down all turns off.  All Good.  However over night things go downhill.  Suncalc() runs but at some point in time after that the ramp up/down crashes it turns on one maybe two channels and that all she wrote.  Adjusting the pot does nothing only thing that works is hitting reset which is hard to get to or unplugging the arduino and pluggging it back in.  For the moment to solve this issue I have the arduino on an Aquarium timer that turns it on and off at night.

Am I asking too much of the mega or do I need to try and clean this up?

I attached my code.

Thanks
-Eilelwen
8  Using Arduino / Displays / Re: Web4robot I2c compatibility issue on: October 10, 2012, 01:43:34 pm
Greetings

I searched the forums found nothing about web4robot and new liquid crystal.  Did fine web4robot and the Menwiz menu. 

I have updated that code to work for the web4robot so this is solved now on to other things which I don't even know how to do yet.

Yea!!
9  Using Arduino / Displays / Re: Web4robot I2c compatibility issue on: October 10, 2012, 09:20:16 am
The I2C board is soldered directly to the LCD with the use of a pin bus.  1 to 1, 2 to 2, etc...

I'll look into the initialization and see if I can figure it out.  One of the things I have noticed is that the Web4Robot sets the Col/Rows in a different spot then the New Liquid Crystal library.

Web4Robot Before Setup()
LCDI2Cw lcd(16, 2, i2cAddress);

In setup it only has: lcd.begin();

This might be what the issue is.  If it is I can't seem to get the new LC to duplicate that.
10  Using Arduino / Displays / Re: Web4robot I2c compatibility issue on: October 09, 2012, 09:49:11 pm
I wasn't sure what you needed.

What do you need code? schematic? both more?

if it helps I'm using the library that works from the web4robot website.
the 2nd library that I'm having issues with is the one I obtained when I tried to test MENWIZ menu system.

I didn't modify the the library files and I am starting with the "Hello World" code.

At first I didn't change anything just upload/test garbage on screen.
Then I started changing code so that it looked like the "Hello World" from the Web4Robot one.  Still had garbage I tried disconnecting the RX/TX wires that resulted in a  blank screen no garbage(atleast it changed)

*Note the Web4Robot code works with these connected or disconnected.

Schematic I followed exactly.  I do have a 2nd I2c board but it works perfectly.


if you need more information let me know, and I will try to supply you with information.
11  Using Arduino / Displays / Web4robot I2c compatibility issue on: October 09, 2012, 07:44:33 pm
Greetings,

I am running into a compatibility issue when I try and use the new LiquidCrystal(F. Malpartida) library.  What I mean by this is a screen filled with garbage.  I'm not sure what to do here it works fine with the supplied library but I know going forward it would be easier if I could use this library. 

I have modified the code for the correct I2c address all this does is change the garbage that is displayed.

I'm at a loss for what to do except use the library that works and start my project from scratch.

Thanks

-Eilelwen

*Project is a Reef LED dimmer controller /w menu for manual control of dimming.
Pages: [1]