arduino and linux

50 views
Skip to first unread message

Dayananda A

unread,
May 1, 2013, 3:28:22 AM5/1/13
to compute...@googlegroups.com

Hi Guys,

    I am trying to deploy contiki on arduino. They have released many ports including Uno. I have been able to compile contiki for a sample hello world program and trying to burn the image using avrdude.

sudo  avrdude -D -p atmega328p -c arduino -P /dev/ttyACM0 -b 115200  -Uflash:w:hello-world.hex

This succeeds only now and then. Most of the times I get the following errors. Could you guys see where I am going wrong? 

avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

I see that there is momentary blinking in the Rx, Tx LEDs on the board but then it fails :(


--
Do more than belong: participate. Do more than care: help. Do more than believe: practice. Do more than be fair: be kind. Do more than forgive: forget. Do more than dream: work.

Sudar Muthu

unread,
May 1, 2013, 3:31:01 AM5/1/13
to compute...@googlegroups.com

On Wed, May 1, 2013 at 12:58 PM, Dayananda A <dayan...@gmail.com> wrote:
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

This happens in two scenarios

- The Arduino has gone bad.
- The serial port of Arduino is busy

Also can you share the link from where you downloaded contiki?

Dayananda A

unread,
May 1, 2013, 3:39:49 AM5/1/13
to compute...@googlegroups.com
Hi Sudar,

  Thanks. Here's the url to clone the repo

git clone 
https://github.com/contiki/contiki-arduino


I am able to burn the image now and then. How's that possible ? What is the best method you suggest to root cause if arduino's gone bad or if serial port if busy ?


--
You received this message because you are subscribed to the Google Groups "Computer Club of India" group.
To unsubscribe from this group and stop receiving emails from it, send an email to computerclubi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Sudar Muthu

unread,
May 1, 2013, 3:52:54 AM5/1/13
to compute...@googlegroups.com
On Wed, May 1, 2013 at 1:09 PM, Dayananda A <dayan...@gmail.com> wrote:
Thanks. Here's the url to clone the repo

git clone 
https://github.com/contiki/contiki-arduino

 
Thanks for sharing the link. I guess there goes my holiday ;)
 
I am able to burn the image now and then. How's that possible ? What is the best method you suggest to root cause if arduino's gone bad or if serial port if busy ?

Were you facing the problem with the same image or with different image?

Also did you face the problem when you used this Arduino with the IDE? Also did you try another cable? 

Dayananda A

unread,
May 1, 2013, 4:03:27 AM5/1/13
to compute...@googlegroups.com
Reply inline


On Wed, May 1, 2013 at 1:22 PM, Sudar Muthu <su...@sudarmuthu.com> wrote:

On Wed, May 1, 2013 at 1:09 PM, Dayananda A <dayan...@gmail.com> wrote:
Thanks. Here's the url to clone the repo

git clone 
https://github.com/contiki/contiki-arduino

 
Thanks for sharing the link. I guess there goes my holiday ;)

Yes. Try it. New OS, great features for sensor networks. Happy hacking :)
 
I am able to burn the image now and then. How's that possible ? What is the best method you suggest to root cause if arduino's gone bad or if serial port if busy ?

Were you facing the problem with the same image or with different image? 

Also did you face the problem when you used this Arduino with the IDE? Also did you try another cable? 

This is my first day with arduino :) hello world in the only image I have tried. I haven't tried another cable. And this arduino is not brand new, I borrowed it from a friend and it was  working just fine with him. He  uses windows and IDE. I have used linux in command line only.

Regards,
-Daya 

--
You received this message because you are subscribed to the Google Groups "Computer Club of India" group.
To unsubscribe from this group and stop receiving emails from it, send an email to computerclubi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dayananda A

unread,
May 1, 2013, 4:19:38 AM5/1/13
to compute...@googlegroups.com
Some consistency now. The write is successful on all counts when I unplug the cable and plug it back.  Looks like the serial is busy all the time once I have loaded the program. I have but one printf there but the Tx line is always busy :D. Got to debug that now. 


Sudar Muthu

unread,
May 1, 2013, 10:20:25 AM5/1/13
to compute...@googlegroups.com
I tried with my UNO and I am consistently able to upload using avrdude without any issues. I didn't use sudo though.

Regarding your Tx issue, how are you trying to read the serial output?

I tried both ttylog and the serial monitor of Arduino, It works in both for me, but at baud rate of 9600

Sudar Muthu

unread,
May 1, 2013, 10:27:51 AM5/1/13
to compute...@googlegroups.com
Also were you able to try out any other examples other than hello world?

I am not able to compile most of them.

Dayananda A

unread,
May 1, 2013, 10:37:41 AM5/1/13
to compute...@googlegroups.com
I tried changing the hello world program to print every one second

Here's the code

PROCESS_THREAD(hello_world_process, ev, data)
{
  static struct etimer et;
  PROCESS_BEGIN();
  while(1)
  {
   etimer_set( &et,CLOCK_SECOND );
   PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
   printf("Seconds:%d\n", clock_seconds());
  }
 // printf("Hello, world\n");
  PROCESS_END();
}
But the output in minicom is all junk :(
��cΟ������0!o�Ν�9� 9�J� 9�J� 9�J� 9�J� 9�J� 9�J� 9�����J� 9�J� 9�J� 9�J� ̹�J� ��J� 9�J� ��J� 9�J��9�J� 9�J� 9�J� 9�J� 9�J� 9�J� 9�݇� 9�J� 9̤J� ��J� 9�J� 9�J� 9�J� 9�J� 9��� 9�̇� 9�J� ��J� 9�J� 9�J� 9�J� 9�J� J

I used baud 9600 and 115200. They just show different junk that's all. Wonder what setting I have missed. Can you tell me the serail port setting of yours? As in stop bit, start bit etc...
ttylog doesn't work at all :(
And I haven't tried any other examples yet. Let me do that and get back.

Dayananda A

unread,
May 1, 2013, 10:41:23 AM5/1/13
to compute...@googlegroups.com
No. I tried the irc example. Throws up a lot of linker errors related to ctk_*

Mohd Laeeq

unread,
May 1, 2013, 10:58:15 AM5/1/13
to compute...@googlegroups.com
@Dayananda : instead of minicom, go with gtkterm, sudo apt-get install gtkterm 
I know it is not exactly relevant to the issue being discussed ;)  just my 2 cents 

-------------------------
Best Regards,

Dayananda A

unread,
May 1, 2013, 11:19:46 AM5/1/13
to compute...@googlegroups.com
Thanks Laeeq,

  Quite a handy tool. Easy to use interface. 

Regards,
-Daya

Sudar Muthu

unread,
May 2, 2013, 10:27:12 AM5/2/13
to compute...@googlegroups.com

On Wed, May 1, 2013 at 8:07 PM, Dayananda A <dayan...@gmail.com> wrote:
I used baud 9600 and 115200. They just show different junk that's all. Wonder what setting I have missed. Can you tell me the serail port setting of yours? As in stop bit, start bit etc...
ttylog doesn't work at all :(

I used your code and I am getting the following output

********BOOTING CONTIKI*********

System online.

Seconds:0

Seconds:0

Seconds:0

Seconds:0

Seconds:0

Seconds:0

Seconds:0

Seconds:0

Seconds:0

Seconds:0

Seconds:0


I got this output both in ttylog and also in Arduino IDE's Serial Monitor. To view in ttylog, I used the following command.

ttylog -V -d /dev/ttyACM0 -b 9600

Sudar Muthu

unread,
May 2, 2013, 10:40:50 AM5/2/13
to compute...@googlegroups.com

On Wed, May 1, 2013 at 8:11 PM, Dayananda A <dayan...@gmail.com> wrote:
No. I tried the irc example. Throws up a lot of linker errors related to ctk_*

I am able to compile only hello-world/ and multi-threading/ in the examples folder. Both are running perfectly in my Arduino Uno.

I am not able to compile any other examples, since almost all of them require some kind of connectivity to internet. 

I am now trying to see, how I can modify it to work with an Arduino + Ethernet shield. Will let you know if I manage to run any of them.

Dayananda A

unread,
May 2, 2013, 10:20:17 PM5/2/13
to compute...@googlegroups.com
Great sudar. Let us know. 


--
You received this message because you are subscribed to the Google Groups "Computer Club of India" group.
To unsubscribe from this group and stop receiving emails from it, send an email to computerclubi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dayananda A

unread,
May 2, 2013, 11:36:52 PM5/2/13
to compute...@googlegroups.com
It's funny it should work at 9600 baud. I saw the code and the in platform_config.h the baud rate is 115200 set by default. I burnt some arduino example binaries from the IDE and saw the output on serial monitor. It is all neat. Which means, no hardware problem. Contiki alone is giving me the trouble. Even at 9600 baud rate.

Viral Sachde

unread,
May 3, 2013, 5:43:59 AM5/3/13
to compute...@googlegroups.com
Hi Dayananda,

May you can check using 'lsof' command whether /dev/tty* device is
properly close or not before trying to use it again. Sometimes,
because of driver / application ioctl issue, device node does not
close properly and thus, when you retry, it doesn't work any more.

Viral
www.cycloid.in
Please try your skills at http://www.freerice.com/index.php

Dayananda A

unread,
May 18, 2013, 12:25:34 AM5/18/13
to compute...@googlegroups.com
Hi Guys,

    The weekend is here and so is my problem with contiki and Arduino.

Viral, 

   I ensured about the device file being properly closed. And still the problem persists.

Here are the tests I have tried.

Arduino + arduino examples on linux =  No problem.
Arduion + arduino examples on windows =  No problem. 

Arduino + contiki on linux  = ��cΟ������0!o�Ν�9� 9�J� 9�J� 9�J� 9�J� 9�J� 9�J� 9�����J� 9�J� 9�J� 9�J� ̹�J� ��J� 9�J� ��J� 9�J��9�J� 9�J� 9�J� 9�J� 9�J� 9�J� 9�݇� 9�J� 9̤J� ��J� 9�J� 9�J� 9�J� 9�J� 9��� 9�̇� 9�J� ��J� 9�J� 9�J� 9�J� 9�J� J

And
Arduino + contiki on windows = ��cΟ������0!o�Ν�9� 9�J� 9�J� 9�J� 9�J� 9�J� 9�J� 9�����J� 9�J� 9�J� 9�J� ̹�J� ��J� 9�J� ��J� 9�J��9�J� 9�J� 9�J� 9�J� 9�J� 9�J� 9�݇� 9�J� 9̤J� ��J� 9�J� 9�J� 9�J� 9�J� 9��� 9�̇� 9�J� ��J� 9�J� 9�J� 9�J� 9�J� J

So looks like contiki is the area I must look into. But I am out of my depths. How do we debug this? 

Regards,
-Daya

Sudar Muthu

unread,
May 18, 2013, 12:30:02 AM5/18/13
to compute...@googlegroups.com

On Sat, May 18, 2013 at 9:55 AM, Dayananda A <dayan...@gmail.com> wrote:
So looks like contiki is the area I must look into. But I am out of my depths. How do we debug this? 

I think it has to do with the baurd rate. 

Can you try to see the output in the Arduino serial monitor itself?

Dayananda A

unread,
May 18, 2013, 12:46:29 AM5/18/13
to compute...@googlegroups.com
I tried it Sudar. Similar output.


--
You received this message because you are subscribed to the Google Groups "Computer Club of India" group.
To unsubscribe from this group and stop receiving emails from it, send an email to computerclubi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Vicky Shah

unread,
May 31, 2013, 3:08:01 AM5/31/13
to compute...@googlegroups.com
hi all,

im looking for a linux developer who can develop image for me for thin client range of products. can work from mumbai or bangalore as ive offices there


intrested ppl, do reply or cal me on 9773372424



vikesh Shah
Reply all
Reply to author
Forward
0 new messages