Comments (6)
Can you provide your script please.
from bluedot.
It's the first sample script from the recipes ( http://bluedot.readthedocs.io/en/latest/recipes.html#mock-app )
from bluedot import MockBlueDot
def say_hello():
print("Hello World")
bd = MockBlueDot()
bd.when_pressed = say_hello
bd.launch_mock_app()
from bluedot.
I see the problem.
I tested running from IDLE which keeps the application alive. If you run from the command prompt as soon as the mock app has finished launching the program ends which simulates the client disconnecting.
If you want to run it via the command prompt you will need to use pause() to keep your program alive.
from bluedot import MockBlueDot
from signal import pause
def say_hello():
print("Hello World")
bd = MockBlueDot()
bd.when_pressed = say_hello
bd.launch_mock_app()
pause()
Ill update the docs.
Also as an aside, I would recommend running your programs using python 3, i.e.
python3 m.py
rather than:
python m.py
which runs as python 2.
from bluedot.
Fantastic! Works like a charm now! Great stuff, this. I really like it a lot, so much potential.
and btw: sorry for the strange font size above, I think I accidentally touched a button....
from bluedot.
Off-topic, but I think you'd like to know this. I installed everything (IDLE on Python3, Pygame, BlueDot etc.) on my laptop (Intel i5, 6 GB running Linux Mint) and the Mock App runs well, but takes almost 98% CPU... My laptop overheated and shut down.
?
from bluedot.
Interesting. pygame must be doing something different with events. The Pi seems to wait until events occur rather than looping.
I have updated the mock blue app (v 0.1.2) to implement a clock, hopefully that will make a difference, its a better implementation.
I have also updated the docs re the original issue.
from bluedot.
Related Issues (20)
- Document - dpad 2 buttons example is missing
- auto run from Pi's Shell HOT 6
- BLE communication between two Raspberry Pi 4 HOT 1
- Documentation: requirement for python-dbus (dbus-python) no longer directly mentioned in docs HOT 4
- Android app not able to connect to Pi HOT 2
- Unablet to connect HOT 13
- Not required "import os" in a recipe
- Web Bluetooth support and GATT HOT 5
- No Attribute AF_BLUETOOTH HOT 2
- Multiple pictures with pi cam
- not possible to check when bluetooth connexion in on HOT 2
- Send connection request from BluetoothServer side as well HOT 2
- Update BlueDot android app to latest google API level HOT 1
- Bluedot android app crashes on pi connection HOT 14
- can't bluedot be used in devices other than raspberry pi ? HOT 10
- Using Blue Dot with Raspberry Pi and HC-05 HOT 2
- Randomly getting ConnectionAbortedError on receive data and 'Transport endpoint is not connected' on send data errors HOT 1
- Raspbery Pi Pico W with Bluetooth HOT 5
- Sending feedback to android client
- Update installation documentation for Raspberry Pi 'bookworm' OS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bluedot.