Bluetooth HC-05 sending error 1F for INQ command only - error-handling

I have a problem with my new bluetooth HC-05 module. In AT-mode it works perfectly with all commands that I need... exept INQ.
I have tried to send whole bunch of other commands beforehand:
AT+INIT
OK
AT+ORGL
OK
AT+ROLE=1
OK
AT+CLASS=0
OK
They all are working just fine. I tried to change IAC and INQM settings as well... but the answer from module is always the same:
AT+INQ
ERROR:(1F)
I read related topic here and tried to push the button at HC-05, as it recommended there, but -- no result either.
I have three modules from the same shop, and they all are working the same way

I have a HC-05 with 3.0-20170601 that I managed to bind to a slave last night. It turns out that the v3 has two AT-modes.
The first is when you hold the button while you connect power. The led will blink slowly and you can connect at 38400 baud. But this is like a configuration mode, where AT+INQ is not available.
In this mode I did these commands:
AT
AT+UART
AT+RMAAD
AT+ROLE=1
(Press and hold the button)
AT+RESET
(Release the button after device restarts and led is slowly blinking)
AT+CMODE=1
AT+INQM=0,5,5
AT+PSWD="9999"
AT should give OK as answer to know connection is working
AT+UART will show configured baudrate. Default is 9600.
AT+RMAAD clears all saved connections
AT+ROLE=1 sets it as master
AT+RESET restarts the device to change to master
AT+CMODE=1 accepts all kinds of devices
AT+INQM=0,5,5 inquires in standard mode, with 5 max connections or 5 secs
AT+PSWD="9999" sets the pin code 9999, change to the pin you need
After this it is time to update the arudino code so that it connects to the configured baud rate. It will be something like
BTSerial.begin(9600);
...or what ever value you might have set the baud rate to. Then reflash your arduino.
Now enter the very irritating second AT command mode.
Power up without holding the button. You will get the fast blink speed. When its powered up, press and hold the button. The led will continue blinking fast, but while the button is pressed you can now connect to the device on the configured baud rate. So open the serial monitor and type AT to verify.
Remember that the mode is only active while the button is pressed. So keep it pressed. I had a small clamp I put on there.
Then I entered these commands:
AT+STATE
AT+STATE will show current state, should be inquiring
Then power up the slave device and the adress should start popping up. It will be something like xyz:xy:xyzw,931F00,7FFF
The first part is the address you want (xyz:xy:xyzw)
Change : to , and get xyz,xy,xyzw
Check that you connecting to the correct device
AT+RNAME?xyz,xy,xyzw
Then bind
AT+PAIR=xyz,xy,xyzw,5
AT+BIND=xyz,xy,xyzw
AT+LINK=xyz,xy,xyzw
The AT+LINK command gave me FAIL as output. But it did not matter.
I restarted and did not press any button before or after. Just normal start.
After 5-10s serial data showed up in my serial monitor.
Modules are bound. And will automatically connect at power up. If not you might have the wrong pincode. Make sure to change 9999 above to 0000 or 1234 or what ever it may be. When I hade the wrong pin I still got OK from the AT+PAIR and AT+BIND commands... It didnt work for me until I entered the correct pin.
Sorry for long post, but I wanted to be thorough since info about HC-05 v3 is very scarce on the internet right now.
A reference to all commands can be found here:
http://www.electronicaestudio.com/docs/istd016A.pdf
(Link valid 2018-08-13)

We have same problem and you can see the answer in here.
The conclusion of problem is about the firmware on HC-05 you use. If you use firmware version 3.0, you will get error 1F in AT+INQ. Maybe HC-05 with firmware version 3.0 has different parameters to run AT+INQ. Now I'm confused about how to find HC-05 with firmware version 2.0. That HC-05 have push button or not.
In short, the answer is: The (B) module with firmware version 2.0-20100601 works ok with the following commands (set PIN34 high at power-up, or press button on module and keep pressed during commands).
So HC-05 with version 2.0 use push button or not, it's the same.
If you have some information about the different between HC-05 version 3.0 and version 2.0, please let me know.

Related

Detecting mouse clicks in terminal emulator w/o breaking scrolling

Using XTERM control sequences (specifically CSI ?1000h), I can get notified on stdin any time the user clicks on the terminal window. Unfortunately this also means I get notified if the scroll wheel is spun, instead of normal terminal scrolling taking place. Is there any way to, preferably easily and simply, just get notified about clicks and nothing else?
Alternatively, is there a way to send an escape sequence that the terminal emulator will interpret as "oh, you want me to scroll normally"? I'd be (reluctantly) okay with having to parse all the mouse commands, and then if I notice a scroll-up signal (button 96 or 64 depending on mode), echo it back saying "here, terminal, you handle this one". In theory these should be the scroll-forw and scroll-back actions, but I haven't found a way to use these directly.
If it makes any difference, I'm using xfce4-terminal, but am willing to try other terminal emulators if it would help with debugging this.
The X10 protocol sends only clicks (no wheel mouse). That's documented. But that's for xterm.
VTE (checking just now with XFCE Terminal) differs from xterm by sending wheel-mouse events. VTE has no documentation worth mentioning, aside from its source-code (ymmv).
The scroll-forw and scroll-back actions are xterm features, for which there are no counterparts in VTE.

Can't move mouse with touchpad

As the title suggests, my touchpad won't move my mouse. I am therefore unable to select outputs of my commands, but I am able to take screenshots of windows. (Luckily I am used to using keyboard shortcuts)
I have no clue what caused this. I have recently updated my kernel from linux52 to linux53 and linux54. Falling back to either of those versions from linux54 hasn't helped. I have also recently been playing around with a Wacom tablet, using xsetwacom, but I believe my mouse has worked after this.
I know it's not a hardware issue, as libinput debug-events correctly detects my finger running over the trackpad:
The output of 40-libinput.conf in /usr/share/X11/xorg.conf.d/40-libinput.conf is the following. I can't see any error there.
I tried blacklisting the i2c_hid, as suggested in the following question, but to no avail. It fixed an error claiming there was a duplicate mouse, which it decided to ignore. I thought this would help.
What is surprising is that I can click. I can't scroll or move the mouse, though. My trackpad lists the following settings. To my surprise, there is no Accel Speed there, and I can't manually set it with xinput --set-prop 14 'libinput Accel Speed' 1.0, as I need to specify the type and format. I don't know what these are supposed to be, and I don't know if the acceleration is the issue. I read that having a negative value would cause the mouse to never move, though.
Do you have any suggestions as to what to do? What does libinput do with the events after receiving them?
EDIT: Removing the blacklist i2c_hid from the modprobe returns the following Xorg log:
Making a copy of /usr/share/X11/xorg.conf.d/70-synaptics.conf into my /etc/X11/xorg.conf.d/ folder, and commenting out the Option "Ignore" "on" line fixed it.
Had to sudo pkill X after changing it, of course. A reboot would also do the trick.

Fail in loading flash loader on IAR Workbench

I am working on IAR Workbench platform V7.70.1 and I am triying to download a simple code (a simple main with a while(1) only into it), but I'm not succeding to download the code on the processor. I am using the board NUCLEO-F401RE of STM company, based on the processor STM32F401RE. I'm am getting the following message:
Failed to load flash loader: C:\Program Files\IAR Systems\Embedded Workbench 7.5\arm\config\flashloader\ST\FlashSTM32F401xE.flash
If someone is familiar with the issue, some help would save me. I read something about this issue on this link but I did not understand what I'm supposed to do:
Thank you in advance
the solution is very simple -
go to Project->Option->Debugger->Download - uncheck the checkbox "Override default.board file".
have a good day
Itshak
Look at the ST-Link reset type. Often the ST debug interface can not connect due to the processor state.
Form the menu bar select Project->Options then ST-Link from the list on the left. The Reset box is normally set to Normal but can be changed to Connect during reset which will hold the processor in reset while connecting the debugger before any code can execute.
For me this worked:
I erase my Port with "CrossCore Serial Flash Programmer"
Then under Project->Options->Debugger->CMSIS DAP->Setup I choose "Software".
Then I debug once.
Then I choose "Hardware" in the same setting window.
Debug again.
Then it worked. Some other software might mess up the correct serial settings, thats why you have to erase and reset them.

What should Connection Settings in Windows Mobile Device Center/Active Stync be when connecting to a handheld device?

As of today, I am no longer connecting to my handheld device.
According to Windows Mobile Device Center, it can't even see it. Doubtless for this very reason, the device doesn't show up in Windows Explorer, either, anymore.
Some of the settings had been changed externally somehow - see this post for more details.
So I got to fooling around with it to see what would make it work again:
I warm-booted the devices several times.
I rebooted the PC a couple of times.
I changed the Connection settings (from "Bluetooth" to "COM1") and, although it seems illogical, toggled off "Allow USB connections"
I even changed out all the hardware: the cradle, the usb cable, and the power cable; I even put a battery in the cradle (it didn't have one before that). Nothing helps. Now Windows Mobile Device Center looks like this:
Is it my settings? What should they be to connect to a (Motorola/Symbol) handheld device?
Or are those (the settings) not even necessarily the problem?
UPDATE
Here it says:
"In the left pane of Sync Center, click Set up new sync partnerships. If your device doesn't appear in this list, then it doesn't support Sync Center."
It does appear, but this is how:
"View sync conflicts" shows nothing, nor does "View sync results"
When I try "Set up new sync partnerships" it doesn't seem to offer me what I need:
(I need to connect to a handheld device, not an old SQL Server DB nor an offline file)
UPDATE 2
It finally connected again.
Since nothing was working, I disregarded the advice and hints I had seen on the interwebs, and set the values to what seemed most logical:
I have all the following tickboxes checked, have "COM1" in the first dropdown, and "Work Network" in the second. When I accpeted those changes, WMDC (nee ActiveStync) shut down. I then manually restarted it, and joy of joys and wonder of wonders, it finally connected again.
UPDATE 3
Now the device lost its connection again "all of a sudden" - and the "Connection Settings" dialog of ActiveStync (Windows Mobile Device Center) somehow grew back its vestigial checkbox, "Allow data connections on device when connected to PC":
What the Deuce!?
For me, anyway, this is how the settings need to look:
Note that the "Allow data connections on device when connected to PC" tickbox is not even visible...?!?

Controlling USB keyboard and mouse

We have a hardware device, with an LCD display. It supports an USB interface to connect keyboard and mose. Using these keyboard and mouse, we can navigate to varios menu items and edit entries.
We have couple of test cases written to verify that mouse click and keyboard input events are working when pressed respective key.
My task is to automate these test cases.
I donot have any control to the hardware device, as I can not access the o/s kernel or any application running there. There is one way to verify what is currently displayed on the UI. So I have to use that and verify whether the mouse/keyboard has performed the appropriate events.
As I have gone through couple of previous posts, it seems like that one of the way to achieve this is through virual HID device driver rather than actual keyboard and mosue. But I am not sure how to achieve it.
Please do help me for it. I am fine with any programming language.
I am more interested to simulate the mouse and keyboard events.
You probably don't need to write your own driver. AutoHotKey does pretty much anything you can think of, and the scripting language is quite easy to learn.
You can get it here:
http://www.autohotkey.com/
Since you're using linux, here's a similar project that will run on linux:
http://sikuli.org/