Show Posts
Pages: [1] 2 3
1  Using Arduino / Programming Questions / Re: IDE hex output issue on: April 01, 2014, 08:52:47 am
Anybody?
2  Using Arduino / Programming Questions / IDE hex output issue on: March 31, 2014, 09:20:37 am
Hello,

I am trying to use Nick Gammon's hex loader (flashes chips with a hex file stored on an SD card, found here: http://www.gammon.com.au/forum/?id=11638).

Everything was going well and I was able to flash the blink script onto other boards; however, when I compiled my own code and placed the hex file on the SD card, I got an error:

Quote
Cannot handle record type: 5
Error in line 2031

Line 2031 is the second-to-last line in the complied hex code, the last lines of which shown here:

Quote
:107DBE001212020E03041B1B1B1B00000000272FB8 (Line 2028)
:107DCE00F62EAF2EB82ECD2EDE2E00000000CE37B2 (2029)
:0A7DDE007338643795377537BE37E8 (2030)
:040000050080043C37 (2031)
:00000001FF (2032, end of hex file)

In researching the Intel hex structure, I found this data type (05) is the "Start Linear Address Record".  This line is not present at the end of the blink.hex file, which ends as such:

Quote
:10041000892B8C932FBF0895CF93DF930E943E01C9
:100420000E949700C0E0D0E00E9480002097E1F396
:0A0430000E940000F9CFF894FFCFFE
:02043A000D00B3
:00000001FF

Do you have any idea what might be causing that 05 type to show up?  My code is pretty close to the max size for a '328, but I've tried suppressing a large portion of the code and it still shows up.

Thanks,
Scott
3  Using Arduino / Project Guidance / Re: Programming (and fuse burning) an Uno with another board. on: March 17, 2014, 02:00:56 pm
I did find this program by Nick Gammon which seems promising as it does the upload and modifies the fuses.

http://www.gammon.com.au/forum/?id=11638

Now trying to figure out if I can modify how he modifies the fuses to fit my needs.  Anyone with suggestions/experience is still welcome.
4  Using Arduino / Project Guidance / Programming (and fuse burning) an Uno with another board. on: March 17, 2014, 01:15:43 pm
Hello all,

The overall goal of my current project is to update a number of remote Arduinos that would be impractical to bring a laptop to, so I would like to do everything with a second arduino board and SD card, if possible.  I have come across a couple different tutorials on uploading a hex file from an SD card on a "programmer" arduino to another board, such as here: http://hackaday.com/2012/02/21/flash-an-arduino-from-an-sd-card/, which I haven't yet tried but seems workable.

The trouble I am running into is that I also need to change some of the fuse settings.  I have found a few posts suggesting that this may be possible to do from a second arduino, but have not any working code - much less one that can also handle the hex file.

No bootloader is needed.

Is this definitively possible? Short of having to translate the datasheet into (non-EE) human speak, is there anywhere else I could look for guidance?

Thanks,
Scott
5  Products / Arduino GSM Shield / Possible to check account balance with GSM shield? on: December 20, 2013, 01:31:42 pm
Hi all,

I was wondering if it is possible to check my pay-as-you-go account balance from the GSM shield.  With my carrier and a normal phone, you would send a text to *777# and get a response.  However, I sent a blank sms message to this number and got no response.  I have read that this may be a different type of message (flash, perhaps?) and am wondering if there is a way to send those from the shield.

Any help is appreciated!

Thanks,
Scott
6  Products / Arduino Yún / Re: Tutorial for python on Linino on: December 06, 2013, 03:21:36 pm
Thanks for the reply.  So you're saying that I write/develop the code directly on the yun, instead of my (windows) pc like you would with the arduino side?  That might be why I was having troubling figuring out how to move the code from one to the other.  Is SSH the LuCI page that I get when I log into the Yun or is that something else?
7  Products / Arduino Yún / Tutorial for python on Linino on: December 06, 2013, 02:54:00 pm
Hi all,

I feel like this should be easy to find - either I'm not using the right search terms or my googling skills have diminished rapidly.

I would like to create a python script on the Linux side of the Yun to handle some of the more processor-intensive aspects of my project.  I am entirely new to both python and linux.  I think I can hold my own with making the python script, but I can't for the life of me figure out how to get the script onto linux.  Is there a tutorial or set of instructions somewhere that I am missing?

Thanks,

Scott
8  Using Arduino / Programming Questions / Re: Edit default response of serial.parseInt()? on: November 01, 2013, 12:34:18 pm
Resolved on my own, tracked down the Stream.cpp file and made a new function with the modified timeout.
9  Using Arduino / Programming Questions / Edit default response of serial.parseInt()? on: November 01, 2013, 12:07:11 pm
Is there a way to edit the default time-out response for the Serial.parseInt() function?  At current, it returns 0, which is a very possible value for my data - I would much prefer to have it return, say, -1, so that I can identify that something has gone wrong and act accordingly.  I have changed things such as this in downloaded librarys, but since Serial/Stream is part of the IDE, I'm not sure where I should be looking/if it can be changed.

Thanks!

-Scott
10  Products / Arduino Yún / Issue with FileIO size() function? on: September 18, 2013, 02:52:17 pm
I'm trying to port some Uno code that used an SD shield to the Yun and it's on-board SD slot.  For some reason, the size() function is throwing the following error:

Quote
Datalogger.cpp.o: In function `loop':
C:\Program Files\Arduino/Datalogger.ino:10: undefined reference to `File::size()'

This is the bare-bones code that I'm trying to compile:

Code:
#include <FileIO.h>

void setup() {
  FileSystem.begin();
}


void loop () {
  File dataFile = FileSystem.open("/mnt/sd/datalog.txt", FILE_APPEND);
  unsigned long test = dataFile.size();
}

Is there something new needed with the Yun that I'm missing?  Any ideas how to solve this?

I have tried FILE_APPEND, FILE_WRITE, and FILE_READ options and all give the same error.

Thanks,
Scott
11  Using Arduino / Networking, Protocols, and Devices / PHP to SQL interface issue on: September 05, 2013, 11:50:35 am
I'm using a php script to act as a go-between for some wifi'ed arduinos and an SQL database.  I have multiple other sections of code that query the database and change data, however this particular segment is throwing an error whenever the conditions are met for it to run (aka there is no error and at least one result in the query) and I can't for the life of me seem to figure out why.  It is not a problem with the connection to the database, as a similar query later in the code works fine every time.  I have checked both the resource type and number of rows via echo after the query and both come back as expected.  Can you see any reasons that might be causing the following error?

Code section:
Code:
$errorFlag = 0;
$result = 0;
$counter = 0;
$sql = "SELECT * FROM Data WHERE Last_Update < DATE_ADD(NOW(), interval -1 MINUTE)";
while (!$result && $errorFlag == 0) {
  $result = mysql_query($sql);
  $counter = $counter + 1;
  if ($counter > 30) {
    $errorFlag = 1;
    echo "#E01,".$counter.",".mysql_errno().":".mysql_error()."!";
  }
}
if ($errorFlag == 0 && mysql_num_rows($result) > 0) {
  while(errorFlag == 0 && $row = mysql_fetch_array($result)) {
    if ($row['Last_Update_Alarm'] == 0) {
      $sql = "UPDATE $tbl_name SET Last_Update_Alarm='1', Status_Time='0' WHERE Machine_ID='$row[Machine_ID]'";
      $counter = 0;
      $result = 0;
      while ($result == 0  && $errorFlag == 0) {
        $result = mysql_query($sql);
        $counter = $counter + 1;
        if ($counter > 30) {
          $errorFlag = 1;
        }
      }
    }
  }
}

Error:
Quote
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\...\test.php on line 33
Line 33 corresponds to the "while(errorFlag == 0 && $row = mysql_fetch_array($result)) {" line in the code segment.

Thanks,
Scott
12  Using Arduino / Networking, Protocols, and Devices / Re: client.available() - strange behavior in Wifi library? on: August 29, 2013, 09:30:48 am
Perhaps, but the order is inconsequential - the cart still moves.  If the connection is lost, there should be no data available, so the first if would not execute and the second would kick it out of the loop.  If you think that is the reason for the code hanging, by all means, please elaborate.

-Scott
13  Using Arduino / Networking, Protocols, and Devices / client.available() - strange behavior in Wifi library? on: August 29, 2013, 08:33:25 am
Hello all,

I'm wondering anyone else has seen strange behavior from the client.available() function when using the Wifi library?  According to the documentation, it is supposed to return the number of bytes to be read in the buffer, much like Serial.available().  However, in practice, it seems to behaving more like a boolean - 0 if there is no client connection, 1 if there is (and therefore available in a different sense of the term?).  In testing, I have never seen it return any value higher than 1, even when I don't immediately read incoming data, which should cause it to back up in the buffer.

In a more specific case, I am wondering if this strange behavior is causing one of my programs to lock up.  I check client.available() and, if it is true, I proceed to peek() and/or read() the data as necessary.  However, I'm thinking that available() is returning a 1 (since the connection is still there) when it should (according to the documentation) be returning a 0 since there is no more data to be read.  Would calling peek/read cause the program to lock if no data was available in the buffer?

Below is the snippet of code that is locking:
Code:
Serial.println("Begin response:");
startTime = millis();
errorFlag = false;
complete = false;
while (!complete && !errorFlag) {
  Serial.println(millis());
  Serial.println(client.available());
  if (client.available()) {
    Serial.println(char(client.peek()));
    complete = client.read() == '#';  //wait to recieve the opening symbol
  }
  else {
    delay(300);
  }
  if (WiFi.status() != WL_CONNECTED) {  //bail out if wifi connection is lost
    Serial.println("Lost connection");
    errorFlag = true;
    state = 2;
    count++;
  }
  if (millis() > startTime + 30000UL) {  //bail out if no response within 30 seconds
    Serial.println("Response timeout");
    errorFlag = true;
    state = 2;
    count++;
  }
}


And the log file showing where it locked:
Quote
Begin response:
213518584
0
213518889
0
213519191
0
213519493
0
213519795
0
213520096
1
H
213520098
1
T
213520100
1
T
213520103
1
P
213520105
1
/
213520107
1
1
213520109
1
.
213520111
1
1
213520113
1
.
.
.
.
.
.
.
213520581
1
/
213520583
1
/
213520585
1
D
213520587
1
T
213520590
1
 

Since the code hung between printing the results of client.available() and client.read(), I'm assuming that this is the issue.  If you see anything else, please share.

Thanks,
Scott
14  Using Arduino / Networking, Protocols, and Devices / Addressable RS-485 to RS232 converter OR splitting serial lines on: August 02, 2013, 03:10:02 pm
I'm hoping you guys might be able to give me some advice on the best approach for this project.  The bare bones of the problem is that I have multiple identical RS-232 sensors that I am looking to communicate with using an Arduino and appropriate transceiver chip(s). 

My initial thought was to utilize multidrop RS-485 with 485-to-232 converters at each sensor.  However, I cannot modify the sensor code and, if my understanding is correct, I would need to use addressable 485-to-232 converters such that only one sensor would respond each time I sent out a request for data.  Since all the sensors respond to the exact same request, is my assumption correct that non-addressable converters would send the command through to every sensor simultaneously and result in a massive mess?  If so, do you know of any reliable, reasonably-priced addressable converters - where reasonably priced means cheaper than building my own addressable converter from an Arduino to use at every node?

As an alternative, I came up with the idea of sticking with 232 and having a way of selecting a specific sensor to communicate with at a time.  For cost and ease of manual assembly, I am looking to stay with a 328 chip, so I am limited to a single TTL serial port (software ports do not begin listening to the receive line soon enough and miss data).  My thought is to use transistors (or some other switching means) to switch either the TTL connections between multiple transceiver chips or switch the output of a single transceiver between a number of 232 lines using additional pins on the arduino (a la SS pins in SPI) and biasing any disconnected transmit lines to their neutral state.  Data is only sent towards the arduino after a request, so I do not have to worry about loosing information when a given line is not requested.  Is this a good idea/possible/crazy?

Thanks!
-Scott
15  Using Arduino / Programming Questions / Searching for ASCII control characters with Serial.find() on: July 18, 2013, 04:00:58 pm
Hello,

I am trying to use Serial.find() to help parse incoming data for a project.  The problem is that one part of the data that I need is immediately preceded by a control code (Start of Text, aka ASCII 2) instead of a printable character.  With a printable character, I would just use .find('A'), but that does not work as easily with a character that is not on my keyboard.  I have tried .find(2) and .find(char(2)) but have gotten invalid int to char* and char to char* conversion errors, respectively.  Is there a way that I can search for this ASCII value with .find()?

Thanks!
Pages: [1] 2 3