This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Bluetooth
#2
Erstmal eine kurze Warnung für alle anderen, die über diesen Beitrag stolpern könnten:
Klassisches Bluetooth war nur experimentell unter Android nutzbar und wird ab Version 1.1.0 nicht mehr unterstützt!

Version 1.1.0 wird zudem bald kommen, also wenn der Einsatz mit den Schülern nicht für die nächsten Wochen geplant ist, kann es sein, dass die Lösung hier dann schon nicht mehr funktioniert.

Nach diesen Warnungen zur Frage, die sich auf recht alten Code bezieht, der nie zu einem offiziellen Feature entwickelt wurde, so dass ich mir nicht mehr in allen Details ganz sicher bin. Wenn ich mich recht erinnere, benötigte diese alte Bluetooth-Unterstützung aber in jedem Fall Zeilenumbrüche um bereits gesendete Zeichen verarbeiten zu können und keinen Time Out zu bekommen. Außerdem berücksichtigt das Protokoll "simple" nicht das Attribut "separator", so dass in jedem Fall ein Zeilenumbruch nötig ist. Daher am besten mal ";" durch "\n" beim Arduino ersetzen. Ich bin mir nicht ganz sicher, ob das Problem wirklich daher stammt, da es mir etwas merkwürdig vorkommt, dass der Code scheinbar beim Einlesen der Datei schon Daten vom Gerät lesen möchte, aber andererseits war das experimenteller Code, so dass ich das nicht ausschließen würde und damit haben wir schonmal einen Anfang um den Fehler zu suchen.

Edit:
Erst aus Reflex auf Englisch geantwortet. Wahrscheinlich weil der Code "Englisch" aussieht. Hier die ursprüngliche Nachricht.

Ok, let me first place another warning for anyone else who might stumble upon this post:
Classic Bluetooth was only supported experimentally on Android and will no longer be available in version 1.1.0!

Version 1.1.0 is not that far away, so if you are not planing on using this feature with your students in the next few weeks, this might stop working by then.

That being said, this question refers to rather old code that has never been completed to be an official feature, so I have to guess a little bit. However, if I remember correctly, the old Bluetooth code required line breaks to process incoming data and to not run into a timeout. Also, the "simple" protocol does not respect the "separator" attribute and expects a line break in any case. So, instead of writing a ";", you should try "\n". I am not entirely sure if this is the problem here as it is a bit weird that the code tries to read from the device right away, but then again this was experimental code and this might be a starting point to search for the problem...
Reply


Messages In This Thread
Bluetooth - by p2019 - 04-15-2019, 08:42 AM
RE: Bluetooth - by Sebastian Staacks - 04-15-2019, 10:59 AM
RE: Bluetooth - by p2019 - 04-15-2019, 01:29 PM
RE: Bluetooth - by Sebastian Staacks - 04-15-2019, 04:43 PM
RE: Bluetooth - by p2019 - 04-15-2019, 05:18 PM

Forum Jump: