Go Down

Topic: Uploading via bluetooth (serial port not listed) (Read 7976 times) previous topic - next topic

Scratchy

Hello,
I'm trying to upload code via bluetooth (Duemilanove 328 + BT module (http://www.ebay.com/itm/150763254858)). When I pair module with PC, serial port loads as /dev/rcomm0 and I can see what sends Arduino (Serial.print()) in serial monitor. But Arduino IDE doesn't see that serial port. I tried with symlink (link to /dev/ttyUSB4), but without success. Any ideas?
Thanks!

cmiyc

Run the IDE as root (or with Sudo).

Does the Serial Port appear then?
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Scratchy

#2
Jun 19, 2012, 11:59 am Last Edit: Jun 19, 2012, 12:06 pm by Scratchy Reason: 1

Run the IDE as root (or with Sudo).

Does the Serial Port appear then?

Thanks, I tried it before. Nope, serial port doesn't appear.

Claghorn

I think the IDE simply refuses to look for /dev/rfcomm0. I seem to recall I had to find the file where it stashes preferences and manually edit it to say /dev/rfcomm0. But I also had big problems timing the manual reset I had to do so the upload would work. See:

http://home.comcast.net/~tomhorsley/hardware/arduino/ITead.html

for some of my experiences with the ITead bluetooth shield.

Scratchy


I think the IDE simply refuses to look for /dev/rfcomm0. I seem to recall I had to find the file where it stashes preferences and manually edit it to say /dev/rfcomm0. But I also had big problems timing the manual reset I had to do so the upload would work. See:

http://home.comcast.net/~tomhorsley/hardware/arduino/ITead.html

for some of my experiences with the ITead bluetooth shield.

Thanks! But in which directory You ran [font=monospace]make clean build[/font] commands?
Which parameter You changed in Makefile (I understanded that You changed bootloader Makefile?) ? Maybe [font=monospace]ISPPORT[/font]?
Thanks, again!

Claghorn


Thanks! But in which directory You ran [font=monospace]make clean build[/font] commands?


The makefile thing only worked after I had completely removed the IDE from my workflow. If you are looking
at my software, the directory where I run make build and make upload is the "microcode" directory, and
the current state of the software is such that I'd need to uncomment the PORT=/dev/rfcomm0 line and
comment out the PORT=/dev/ttyACM0 line. Then after doing a "make build" I type a "make upload"
command in a terminal and try to hit return in the terminal at the same time I release the reset button
on the arduino (but the timing is still tricky). I pretty much decided it was easier to change the jumpers
and upload over the USB connection when I need to upload.

This web page for the teensy:

http://www.pjrc.com/teensy/jump_to_bootloader.html

implies that you can jump to the bootloader from your sketch (if you build a sketch that can take a command
to do that some way), but I haven't tried that yet with my Uno.

Scratchy



Thanks! But in which directory You ran [font=monospace]make clean build[/font] commands?


The makefile thing only worked after I had completely removed the IDE from my workflow. If you are looking
at my software, the directory where I run make build and make upload is the "microcode" directory, and
the current state of the software is such that I'd need to uncomment the PORT=/dev/rfcomm0 line and
comment out the PORT=/dev/ttyACM0 line. Then after doing a "make build" I type a "make upload"
command in a terminal and try to hit return in the terminal at the same time I release the reset button
on the arduino (but the timing is still tricky). I pretty much decided it was easier to change the jumpers
and upload over the USB connection when I need to upload.

This web page for the teensy:

http://www.pjrc.com/teensy/jump_to_bootloader.html

implies that you can jump to the bootloader from your sketch (if you build a sketch that can take a command
to do that some way), but I haven't tried that yet with my Uno.

Thanks! Ohh, thats quite hard way. Yesterday I was trying with avrdude. I ran
Code: [Select]

rfcomm bind 0 00:12:02:10:79:36 (bluetooth module address)
avrdude -c arduino -p m328p -P /dev/rfcomm0 flash:w:home/tadas/Desktop/Blink_Test_Serial.cpp.hex -v -v -v -v -b 57600

,but then I got
Code: [Select]
avrdude: ser_recv(): programmer is not responding
Any suggestions?

legwinskij

What baud rate you have on your BT module ? because it has to be the same that the rate of which you're uploading with in this case 57600, and have you tried to reset the board manually just after you send that avrdude command ? Remember there is no autoreset feature when dealing with BT. I was programming my arduino via bluetooth on the windows 7, there were some issues with the timing of that reset. Haven't tried it on ubuntu yet, but I will look into it

Scratchy


What baud rate you have on your BT module ? because it has to be the same that the rate of which you're uploading with in this case 57600, and have you tried to reset the board manually just after you send that avrdude command ? Remember there is no autoreset feature when dealing with BT. I was programming my arduino via bluetooth on the windows 7, there were some issues with the timing of that reset. Haven't tried it on ubuntu yet, but I will look into it

Yes, I tried reset board, but nothing happens. How to set BT module baud rate? In description it says that by default baud rate is 9600.
Thanks!

legwinskij

If you want to change baud rate on your bluetooth module you need to bring it to AT mode (there should be a switch or you need to pull some pin down check some datasheets) and then you need to connect it to the PC via FTDI and chanage it with AT commands.

Scratchy

#10
Jun 27, 2012, 05:15 pm Last Edit: Jun 28, 2012, 06:12 pm by Scratchy Reason: 1

If you want to change baud rate on your bluetooth module you need to bring it to AT mode (there should be a switch or you need to pull some pin down check some datasheets) and then you need to connect it to the PC via FTDI and chanage it with AT commands.

Thanks! Oh, I thought that I need AT commands. Finally uploaded with bluetooth! :)
First I changed baud rate to 57600 via ttl to serial cable, because AT commands (AT+BAUD, AT+VERSION etc) via Arduino didn't worked (except AT, it returned OK). But first I suggest to try via Arduino, because for others it worked.
Then I binded BT module
Code: [Select]
rfcomm bind 0 00:12:02:10:79:36
and ran avrdude
Code: [Select]
avrdude -c arduino -p m328p -P /dev/rfcomm0 -U flash:w:/home/tadas/Desktop/Blink.cpp.hex -v -v -v -v -b 57600

legwinskij

I'm glad it worked :). To be honest for the purpose of changing baud rates and other AT commands I use PuTTY, because Arduino serial monitor doesn't work for me, so I reccomend you PuTTY, it's free, crossplatform and awesome :D

Scratchy


I'm glad it worked :). To be honest for the purpose of changing baud rates and other AT commands I use PuTTY, because Arduino serial monitor doesn't work for me, so I reccomend you PuTTY, it's free, crossplatform and awesome :D

Yup, when I used Windows I always used PuTTY, but I thought that PuTTY for Linux doesn't exist, but I was wrong, so week ago I installed PuTTY. :) But it little sucks, because I can't do copy/paste, so with AT commands I needed use other serial terminal. If I remember, in Windows You can do copy/paste, right?

legwinskij

I don't know I'm typing commands old style, I'm using PuTTY even on my Windows mobile phone :D

Go Up