I bought an hm-10 bluetooth ble module , and connected it to my arduino nano , when the hm-10 module was set to 9600 baud rate it worked just fine,
The problem is that i've changed the baud rate of the hm-10 module to 38400 with the arduino ide console and now i cant get it back to 9600, because the module doesn't understand the commands from the console (eg. if i write AT+BAUD4 the console just return weird characters)
I tried changing the software serial.begin to 9600 or 38400 but nothing works, my code is
#include <SoftwareSerial.h>
SoftwareSerial miBT(10, 11);
void setup(){
Serial.begin(9600);
Serial.println("Listo");
miBT.begin(9600);
}
void loop(){
if (miBT.available())
Serial.write(miBT.read());
if (Serial.available())
miBT.write(Serial.read());
}
Have you changed the baud rate in Arduino serial monitor?
Related
So, my knowladge in embedded development is quite bad and now I am trying to receive some data from PC inside my MCu STM32F429IGT6 which is on WaveShare Core4X9I dev-board and send it back via USB Virtual COM Port.
I realized how to set up connection from MCu part and I even see connected device from Windows 10 Device Manager but... it appears as STM Device in DFU Mode
I have tryed already to install drivers from ST for such things but they are useless and official documentation says that they are not needed for Windows 10.
I have been following tutorials where guys just clicked several times inside Cube MX, generated code and VCP worked out of the box.
The question is what am I doing wrong? I don`t even know what information you might ask for thats why I created GitHub repo: https://github.com/dessy4oko/stm32f429-vcp-appears-as-dfu
And this is events from Device Manager of Windows 10 (translation from ru lang):
Device USB\VID_0483&PID_DF11\305233703237 is running. code 410
Device USB\VID_0483&PID_DF11\305233703237 is configured. code 400
Device USB\VID_0483&PID_DF11\305233703237 have not been moved due to partial or ambiguous matching. code 442
Device USB\VID_0483&PID_DF11\305233703237 requires further installation. code 430
Thank you for any information about my mistakes.
STM32 starts in DFU mode if BOOT-pins are pulled accordingly:
"System memory" means embedded bootloader, DFU in this case. You need "Main Flash" to run your app.
Check jumpers and switches on your board. Refer also to the AN2606 app note for complete information.
I'm studying and developing a module to stream and control a CSI-2 camera, but I don't have device(It's being shipped).
I added device tree, code for config, read/write on I2C bus, defined some v4l2 operator functions,..
Could you tell me how to to test a module without device? Thanks in advance!
I have scoured the internet to this problem and am unable to find any kind of answer. Here is the gist of the project and what I have done so far
Project: Our school participates in sounding rocket competitions. I am in charge of payload and part of our payload includes GPS. Our rocket goes up to 2 miles and does not break the sound barrier
GPS module: Adafruit ultime GPS breakout
Raspberry Pi Model: B+ or 2 (we have access to both)
Problem: Since the rocket travels very quickly (arroximately 700-800 ft/s) we need the GPS to update at a faster rate than once per second (default rate). I have 2 raspberry pi's that both use GPSD daemon, and a personal python script. The problem lies within: With debian Wheezy, I can set the update rate from the bash with the following commands
"echo -e "\$PMTK251,57600*2C\r\n" > /dev/ttyUSB0" - updates baudrate
"echo -e "\$PMTK220,200*2C\r\n" > /dev/ttyUSB0" - updates NMEA sentences
"stty -F /dev/ttyUSB0 57600 clocal cread cs8 -cstopb -parenb" - updates baudrate of raspberry pi
On debian Wheezy these commands work and I get GPS coordinates at a rate of 5 times per second. - no problem.
The other pi uses Debian Jessie, which when I run the exact commands they do not work and the GPS unit continues to update at its default rate of once per second.
I am very confused as to why it will work on Wheezy but on Jessie it refuses to cooperate.
Some additional info:
- We communicate over USB0, (not AMA0)
- Jessie natively does not support GPS functions and one has to manually change how to listen to GPS chips (wheezy natively supports this and no changes are necessary),
- we are using full Jessie (not lite).
- When I change the baud rate of the Pi Jessie, and I follow up to see what its set at (using: stty -F /dev/ttyUSB0 -a) it tells me the baud rate is whatever the new value i gave it (i.e./ 57600).
So i believe the problem lies with setting the actual GPS units baud rate/NMEA sentencing
I think I have included all pertinent information but if I left something out I apologize and can clarify anything that isn't clear enough.
Any help would be greatly appreciated since we would like to upgrade to Jessie (other chips and programs that we incorporate on the sounding rocket run smoother with Jessie) but the GPS is a major reason not to.
I realize that this is an old thread, but since I ran into the same problem I will post my solution so that it possibly may help someone else.
I have a Raspberry 3 B+ running Raspbian Stretch, Adafruit Ultimate GPS attached to ttyAMA0. For RPi3 the bluetooth module needs to be disabled by adding the following line to /boot/config.txt:
dtoverlay=pi3-disable-bt
Anyway, I have previously been able to program the GPS module by echo commands, as described above. However, no success this time. Finally I managed to program it by installing the terminal program CuteCom.
Start the program, change the baud rate under settings, and press Open. The NMEA sentences should then appear in the lower part of the window. Make sure that the line end termination is set to CR/LF, and give the input command directly without hyphens or line terminations. For example to change the baud rate to 57600 write:
$PMTK251,57600*2C
The connection then have to be closed, the baud rate changed accordingly and then opened again. I noticed that sometimes the command needs to be repeated before the change takes place. If the backup battery is installed on the GPS module the settings are kept when power is lost.
I've an USB hub (Plugabble) with a usb Daffodil sound card.
The Speakers are working great, but the microphone is not working. I don't know what to do anymore to get it working.
The usb sound card is set as default
The arecord command records but no sound is recorded.
The aplay play sounds nicely.
Here are some of my settings:
pi#raspberrypi ~ $ arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=Set
C-Media USB Headphone Set, USB Audio
Default Audio Device
sysdefault:CARD=Set
C-Media USB Headphone Set, USB Audio
Default Audio Device
front:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
Front speakers
surround40:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Set,DEV=0
C-Media USB Headphone Set, USB Audio
IEC958 (S/PDIF) Digital Audio Output
pi#raspberrypi ~ $ sudo lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 005: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 006: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
pi#raspberrypi ~ $ sudo amixer set Capture cap 8
amixer: Unable to find simple control 'Capture',0
pi#raspberrypi ~ $ amixer
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch pswitch-joined penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 151
Mono:
Front Left: Playback 44 [29%] [-20.13dB] [on]
Front Right: Playback 44 [29%] [-20.13dB] [on]
Simple mixer control 'Mic',0
Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined penum
Playback channels: Mono
Capture channels: Mono
Limits: Playback 0 - 32 Capture 0 - 16
Mono: Playback 23 [72%] [34.36dB] [on] Capture 9 [56%] [13.39dB] [on]
Simple mixer control 'Auto Gain Control',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Thanks!
This depends on you distribution, since different distributions handle the devices differently.
So i think you are running a raspian jessy but tried to configure it like you where on a wheezy.
So if I am right you should go into the file alsa.conf with the command
sudo nano /usr/share/alsa/alsa.conf and edit the lines
defaults.ctl.card 0
defaults.pcm.card 0
to
defaults.ctl.card 1
defaults.pcm.card 1
then go to the file .asoundrc with the command sudo nano /home/pi/.asoundrc and edit it so it looks like following:
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
do an reboot and hopefully it will work.
If i was wrong with my guess please comment under the answer and i will update it :) hope it helped.
I have a code burned on Arduino uno and I want to get the hex file of this code back?!
How can I make that ?!
On this forum it says you can extract the code from the Arduino to your computer but it will be in executable code which you cannot edit (it would probably be faster to rewrite the program)
http://forum.arduino.cc/index.php/topic,48218.0.html
You can read-out flash from an AVR via the ISP (if it has not been disabled) if you have suitable hardware/software. You can build the hardware using another Arduino, use "avrisp" as the ISP interface device ID in avrdude.
Do not disable the power to the AVR's SPI port - this will also disable the ISP interface (same pins), and lock you out permanently if you don't have a working bootloader to load code to re-enable again!