Sunray App Problem: "writeCharacteristic error 11"

hanoba

Member
I am using the Sunray App v1.0.113 and Sunray FW 1.0.168. The app connects to the mower without problem . When I want to move the mower forward via the touch screen, then this works 2 or 3 times (the motors start for a short time) but then it does not work anymore - the app hangs.

The the app log (via "=" button) shows:
resending request: AT+M,0.03,-0.04
writeCharacteristic error 11

Entering the command "AT+M,0.03,-0.04" via the Console works without problems.

I hope someone can help. Many thanks in advance!

Harald
 
Hello,
Android or iOS? What device model? Thanks!
PS: We experienced that certain Android or iPhone models do not work or do not work well with the Marotronics BLE module. Often changing the device or trying out an BLE module replacement solves all issues. Also note that (without external antenna) the maximum error-free distance for the BLE chip antennas is about 5m.
Regards,
Alexander
 
Zuletzt bearbeitet:
I tried both an iPad Pro with iPadOS 14.4 and a Samsung Galaxy Note 9 (SM-N960F) )with Android 10. Both show the same problem.
The distance was only about 1m. Can you recommend a BLE module? I use the one from the shop.
I also tried already to bypass the TX2 level shifter as proposed in the Wiki. But without success.
Thanks and regards
Harald
 
When I reconnect the app to the mower, then it works again for a short period of time and then the app hangs again as before (the mower does no longer receive the periodic "AT+S,0x13" BT messages).
After reconnecting the app, the following BT messages are displayed on the console:
AT+M,0.33,-0.04,0xAT+M,0.33,-0.04,0xAT+M,0.33,-0.04,0xAT+M,0.33,-0.04,0xAT+M,0.33,-0.04,0xConnected
CRC ERROR received: 0xC, expected: 0xC8
It seems that the app does not wait for a confirm from the mower before sending the next "AT+M" message(s). Could this be a bug in the app?
Thanks and regards
Harald
 
I'll try to reproduce and fix the issue. Meanwhile, please let me know if the issue is gone on your side. Thank you!
 
So, I simulated a faulty connection (simulation code can be activated in comm.cpp : 'simFaultyConn=true'), and it did work. The motors will stop on CRC errors, however the phone will resend after 10 seconds and then motors will continue.
Now the question is why you get a faulty connection ... (Typically, CRC errors only rarely appear after several minutes or so and are not noticeable). Btw, you probably will not be able to upload maps to the mower with such a faulty connection.
Maybe you just had no luck and your module is a broken somehow.

Can you verify your PCB1.3 BLE module setup is correct (Bluetooth signal level and supply voltage) ? https://wiki.ardumower.de/index.php?title=Ardumower_Sunray#Bluetooth_BLE_UART_module

Maybe you have a chance to try out someone else (Android) phone just to verify it is not your specific phones having some BLE issue?
 
Zuletzt bearbeitet:
Thanks a lot for checking a faulty connection!

Please note that I do not get any CRC errors, even if the connection is running for a long time. The phone is periodically sending "AT+S,0x13" and battery voltage and GPS position displayed by the app are correct. Also displaying the statistics with the app works without problem.

The problem is that the "AT+M" commands and any other commands from the phone are no longer received by the mower after moving the mower via the touch screen!

When I make a reconnect with the app then I receive this string "AT+M,0.33,-0.04,0xAT+M,0.33,-0.04,0xAT+M,0.33,-0.04,0xAT+M,0.33,-0.04,0xAT+M,0.33,-0.04,0xConnected" and a CRC error.
Note that the checksum and the "\r\n" after each "AT+M" command are missing!

If checked again my PCB v1.3 and everything is correct. I also followed this advice from the Wiki: "If your experience Bluetooth module communication issues, have a look at the GPS RX pin fix and perform the same RX pin fix for the Bluetooth RX pin".

I will try another Android phone as you proposed and I will order a new HM-10 module.

You wrote "We experienced that certain Android or iPhone models do not work or do not work well with the Marotronics BLE module". Do you have an advice which BLE module I should order?
 
Thanks! Meanwhile I tested with a Samsung Galaxy A6 from my neighbor. It shows the same problem! I have added my findings to your compatibility list.
 
I did some more debugging and I know now what happens. When steering the mower via the app, the mower receives the following data via BLE:
AT+M,0.33,-0.01,0xAT+ . . .
AT+M,0.33,-0.01,0xAT+ . . .
AT+M,0.02,-0.00,0xAT+ . . .
AT+M,0.02,-0.00,0xAT+ . . .
AT+M,-0.04,-0.03,0AT+ . . .
AT+M,-0.04,-0.03,0AT+ . . .
Only the first 18 bytes of the AT+M command are received,. The checksum and the "\r\n" are missing.
I implemented a SW workaround in the Sunray firmware (comm.cpp) for this and steering the mower via the app is now working.
However, this workaround will not work for longer messages, like map coordinates. For this a workaround in the app would be needed.
I will get a new HM-10 module tomorrow. I hope this will solve the problem.

One question: What HM-10 firmware version do you have?
 
I have firmware version 4.2.0 (see below). I think you could try to change firmware like described here (I have no experience with this): https://forum.arduino.cc/index.php?topic=393655.0

Ardumower Sunray console output at power-on:
+NAME=Ardumower
OK
BLE: AT+LADDR
+LADDR=00:13:AA:00:2D:95
BLE: AT+CHAR
+CHAR=0xFFE1
BLE: AT+VERSION
+VERSION=Firmware V4.2.0,Bluetooth V4.0 LE
BLE: AT+RESET
+RESET
OK
 
Zuletzt bearbeitet:
@bernard reasons: ESP32 needs to be programmed ;) (one task more to TODO is less attractive to buy a DIY mower for ordinary users that start with electronics ;-) ) and BLE because it works on iOS devices (iOS have many users, has big market share and only supports BLE)
However you are right, an ESP32 could be (with some software development work) programmed to act like a BLE serial module...
 
Zuletzt bearbeitet:
I have firmware version 5.3.
The version info I get is quite different:
AT+VERSION
+VERSION=v5.3
 
Zuletzt bearbeitet:
I received my new HM-10 module (DSD-TECH) today. Now everything works perfect (without any SW workaround).

PS: Some adaptations of the AT command handling was needed. The module from DSD-TECH is not compatible with the one from the shop.
 
Oben