Show Posts
Pages: [1] 2
1  Using Arduino / Networking, Protocols, and Devices / Re: How to send a simple 6-byte packet using NewSoftSerial? on: February 19, 2011, 04:42:14 am
Oh, it looks like I have it now.  I changed the command to:
Code:
//Now ask for the Supplemental (Secondary) Packet
   for (m=0; m<6; m++){
    // send the request byte
mySerial.print(BothReq[m],BYTE);
}

Thanks to the hint from AdderD in:
http://arduino.cc/forum/index.php/topic,2947.0.html
2  Using Arduino / Networking, Protocols, and Devices / How to send a simple 6-byte packet using NewSoftSerial? on: February 19, 2011, 03:22:06 am
I have a device interfaced to my Uno via NewSoftSerial on Pins 2&3.  Level conversion to RS232 is done via a board with a MAX232 IC.  It is operating at 9600 bps.  I've looked through many posts on the forum and not seen anything on how to generate a packet with NSS.  I need to send a simple 6-byte ASCII/HEX command packet to the device, namely 10 8F AC 02 10 03.  I've tried to do this multiple ways, and I cannot get the device to respond.

I've tried to do it as a series of NSS print commands, like:
mySerial.print(0x10);
mySerial.print(0x8F);
etc.

I've put the bytes into an array and tried to send them as a series of NSS print commands in a For-Next loop:
for (m=0; m<6; m++){
    // send the request byte
      mySerial.print(BothReq[m],HEX);
This I have tried with the array stuffed with hex values and with decimal equivalents...no luck.

I read about buffers and using a Write statement, but when I tried it in NSS I got error messages saying that I could not use mySerial.write() in NSS.

I've been able to read packets broadcast by the device, so I know the port and TTL-to-RS232 interface shield is working, but I cannot seem to send the required packet.   Any hints would be appreciated. Thanks in advance.
3  Using Arduino / Project Guidance / Re: Use Uno to read and display status from Thunderbolt GPS time std? on: February 19, 2011, 01:57:17 am
Thank you, liudr, for explaining that mystery to me!

Yes and no on reading the data.  It is not NMEA, but rather TSIP protocol.  I've been able to read streaming broadcast packets of data from the device via NewSoftSerial, but there is occasionally an extraneous byte, for reasons I cannot figure out, and sometimes I fail to read the DLE (0x10) and the ETX (0x03) bytes that signify the end of the packet.  Nowhere could I find examples of a receive buffer, so I made my own.  I read that NSS needs to remain singly focused, so I've tried simple code like:
Code:
if (mySerial.available() > 0) {
// loop till something in buffer, then read the incoming byte from the soft serial RX port:
for (k=0; k<99; k++){
  if (mySerial.available() > 0) {
  // read the incoming byte
RecBytes[k] = mySerial.read();

}
  }
}
if (mySerial.available() > 0) {
  // dont print till you get something

                Serial.println("Received data is:");
                  for (l=0; l<99; l++){
                    Serial.println(RecBytes[l],HEX);
                }

(Sorry if the code doesn't show up in a box...I cannot seem to get that icon to work).

Only working at 9600 bps, so I don't think it is a timing challenge.  Any thoughts appreciated!!  Thanks again.
4  Using Arduino / Project Guidance / Re: Use Uno to read and display status from Thunderbolt GPS time std? on: February 10, 2011, 03:59:54 pm
Disregard my last.  I closed all windows and then reopened them and then recompiled the same sketch and now it compiles with no problems.  Weird stuff...
5  Using Arduino / Project Guidance / Re: Use Uno to read and display status from Thunderbolt GPS time std? on: February 10, 2011, 03:42:01 am
I tried the NewSoftSerial and bombed out.  I downloaded it and unzipped it to a folder in my Libraries folder (which is inside my Arduino0021 folder).  This action put a NewSoftSerial.h file and a NewSoftSerial.cpp file and a Keywords.txt file in that folder.
I then made a sketch using the NewSoftSerialTest example from the download:
Code:
#include <NewSoftSerial.h>

NewSoftSerial mySerial(2, 3);

void setup() 
{
  Serial.begin(57600);
  Serial.println("Goodnight moon!");

  // set the data rate for the NewSoftSerial port
  mySerial.begin(4800);
  mySerial.println("Hello, world?");
}

void loop()                     // run over and over again
{

  if (mySerial.available()) {
      Serial.print((char)mySerial.read());
  }
  if (Serial.available()) {
      mySerial.print((char)Serial.read());
  }
}


When I compiled it, I got the following errors:

NewSoftSerialTest.cpp:2:27: error: NewSoftSerial.h: No such file or directory
NewSoftSerialTest:3: error: 'NewSoftSerial' does not name a type
NewSoftSerialTest.cpp: In function 'void setup()':
NewSoftSerialTest:11: error: 'mySerial' was not declared in this scope
NewSoftSerialTest.cpp: In function 'void loop()':
NewSoftSerialTest:18: error: 'mySerial' was not declared in this scope
NewSoftSerialTest:22: error: 'mySerial' was not declared in this scope

Did I put the code in the wrong place?  Help, please!
6  Using Arduino / Project Guidance / Re: Use Uno to read and display status from Thunderbolt GPS time std? on: February 03, 2011, 03:43:58 am
Thanks, liudr, for the great tips.  Will go check that softserial stuff out.  Cheers!
7  Using Arduino / Project Guidance / Use Uno to read and display status from Thunderbolt GPS time std? on: February 02, 2011, 11:52:35 pm
Hello. I am a neophyte who has done just a few simple things with my Uno.  I have a Trimble Thunderbolt GPS Disciplined Oscillator that runs by itself, however it can put out status on its RS-232 port such as whether it is locked, or not.  An amateur radio guy put a nice video on YouTube in which he used a PIC-based controller to read and display the status from his Thunderbolt:
 


I'd like to try to use my Uno to do something similar.  I have an LCD1602 display from an Electronic Brick starter kit that runs off of Bus 2 on the seeedstudio interface shield.  If I buy a TTL-to-RS232 level converter, can I send/receive simple NMEA-like commands on the Uno hardware serial interface (Pins 1 and 2, as I understand it), and then receive, decode, and display a simple message on the LCD such as an Alarm condition or Receiver is Locked?  Will writing the LCD conflict with TX/RX on the serial port?  I assume the Uno is as powerful as the PIC and has the bandwidth, but is that a rash assumption?  Any ideas or coding suggestions would be greatly appreciated.  Thanks in advance.
8  Forum 2005-2010 (read only) / Troubleshooting / Re: Help get Arduino 21 installed on my Ubuntu machine on: December 25, 2010, 05:35:58 pm
SUCCESS!  0022 ran.  I was able to select the Uno board.  I successfully uploaded a sketch.
Thanks all who helped, particularly mrtaylor, who invested a lot of time.  You've made this old man happy.  God bless.
9  Forum 2005-2010 (read only) / Troubleshooting / Re: Help get Arduino 21 installed on my Ubuntu machine on: December 25, 2010, 02:53:12 pm
Thanks, Pluggy, for the alternate suggestion, but I am so uninitiated in Linux I am afraid I'd screw it up.
I, too, was surprised to learn from mrtaylor that 0022 was out.
mrtaylor, I changed the Find command per your suggestion, and the only two librxtxserial files that it found were in the Arduino 0021 and 0022 packages.  I initiated a file search of my own under the Places pulldown, and those were the only two found.  Does this mean that when my son built this machine that he may have missed a library file?  I think I've successfully used the USB port on this machine in the ast, but am not sure of that.
10  Forum 2005-2010 (read only) / Troubleshooting / Re: Help get Arduino 21 installed on my Ubuntu machine on: December 25, 2010, 01:26:41 am
Well, Mark, I got about halfway through it (I did have to add a z to the tar command, then it seemed to work).  Later, it seems to have encountered trouble after I told it to search for the serial library, and it asked me for my password:

fred@fred-desktop:~/Downloads/arduino-0022/lib$ sudo find / -ls|grep -i librxtxSerial
[sudo] password for fred:
find: `/home/fred/.gvfs': Permission denied
6079956   48 -rw-r--r--   1 fred     fred        48304 Dec 24 14:12 /home/fred/Downloads/arduino-0022/lib/librxtxSerial.so.orig
6078967   48 -rw-r--r--   1 fred     fred        48304 Oct  2 13:17 /home/fred/Desktop/arduino-0021/lib/librxtxSerial.so
find: /proc/2/task/2/exe: No such file or directory
It repeated the "No such file or directory" line for a couple of hundred different task numbers.

I'm gathering that I am lacking some sort of permission that was required. Am I hosed?  Do I need to go in and restore something on that lib that I backed up?

Again, I appreciate your help.  If it is "a bridge too far" for a lame-o like me to do this, please feel free to tell me so.  Tnx, fred
11  Forum 2005-2010 (read only) / Troubleshooting / Re: Help get Arduino 21 installed on my Ubuntu machine on: December 25, 2010, 12:41:53 am
Thanks very much, MrTaylor.  I appreciate your taking the time to lay that out for me.  Will give it a try.  Cheers, and Happy Holidays.
12  Forum 2005-2010 (read only) / Troubleshooting / Help get Arduino 21 installed on my Ubuntu machine on: December 24, 2010, 09:10:21 pm
I've pored over dozens of posts similar to this topic, but I am LINUX and C illiterate, and am struggling.  I need to get Arduino 0021 onto my Ubuntu V10.10 machine, in order to drive my Aduino Uno.  I tried installing Arduino from the Ubuntu Software Center, but it only provides Version 0018.  I tried loading/istalling it via "sudo apt-get" from a Command Line in a Terminal, but again it only came up with V.18.  I downloaded Arduino 0021 from Arduino.cc, and extracted it, but don't know how to get it to install.  I read about Debian and downloaded 0021+dfss-2.debian and got it to extract, but cannot figure out how to get debian to install it.  Can anyone give me really simple advice on how to get either of these downloads to install?  Any assistance will be appreciated...thanks in advance.
13  Forum 2005-2010 (read only) / Troubleshooting / Re: Cannot upload Uno from Ubuntu machine on: December 24, 2010, 08:54:04 pm
I also did some reading and learned about Debian.  I found a downloadable version of Arduino 0021 in Debain and got it extracted onto my computer, but still couldn't figure out how to get that last bit done to get it installed. Since this thread is long, and since I now have a different question, I will post a slightly different question.
14  Forum 2005-2010 (read only) / Troubleshooting / Re: Cannot upload Uno from Ubuntu machine on: December 24, 2010, 04:39:39 pm
Okay, Paul, hopefully Mr. Taylor can.  But thank you for getting me started.  I see now what happened...I downloaded the 0021 from the ARduino site and evidently installed 0018 from the Ubuntu Software Center.  If Mr. Taylor can tell me how to install the 0021 file that I downloaded, I may be good to go.  Thanks.
15  Forum 2005-2010 (read only) / Troubleshooting / Re: Cannot upload Uno from Ubuntu machine on: December 24, 2010, 04:21:07 pm
No, Mr. Taylor, it is not working.  Following the lead of the last comment from PaulS (thanks Paul) I checked under Tools>Board and did not see the Uno listed.  Then I looked at the title atop the Sketch and it referred to Arduino 18.  I went to the Ubuntu Software
Center and it shows the available version as 0018+dfss-4, plus it has a note that Canonical does not update Arduino.  Somehow when I started this last week, I got Arduino 21 downloaded onto my computer, and I extracted the files into a folder on my desktop.  I was laboring under the impression that I was running that version, but somehow it was running 0018. I just deleted Version 0018, but cannot figure how to get 0021 installed now.  I am running Ubuntu 10.10, and it is current.  Thanks, you guys...it is giving me hope that I can get this thing working.
Pages: [1] 2