Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello ā I'm @olemoritz on Twitter.
Back and forth BLE: Pythonista and Pi
-
Hello, I could really use some help here.
Iād like my Pi to send a signal to my iphone via bluetooth when a certain condition is met (like a sensor on the Pi reads over 60 degrees fahrenheit), and the signal will cause my phone to buzz until the condition is no longer met (like when the sensor reads less than 60 degrees).
I have paired/connected my phone and the pi using the pi iphone app. Any advice or tips on how to proceed from here would be much appreciated.
-
@tylersuard Thats does not answer to your question but you can run on your pi a python script that posts a request to IFTTT webhook to send a notification to your iPhone, not in Bluetooth but in WiFi.
-
Take a look at the cv module documentation.
It might also be helpful to look at the Python examples for Linux/Pi BTLE stuff.
Im not sure anyone here has the time to build out a functioning example.
Notes:
You can send notifications to the phone, but you can't have it ring continuously unless you have a corporate certificate (and even then it's challenging)
Your best option is email, or to look at your mobile provider to see if they provide a free sms gateway you can use.
Else, you can use push notifications (paid generally) and have your mobile app open up to a status page.
Wifi networks are the easiest- as you could write a simple API that would sit on the pi.
Have the app poll the server on a regular interval during an alarm state, and stop polling once it has cleared.
You will be able to use the app to monitor what is happening.
Hope this helps in some way
-
@tylersuard example of script you can run on any machine
You have to "buy" (for free) IFTTT, create an applet using web hook service and notifications trigger. That's all and the server will push (for free) the notification on your idevice, even if the IFTTT app is not started.# Use IFTT applets of webhooks service import requests import json key = "xxxxxxxxx" # my key event = 'my event name' payload1 = 'http://www.........' # link url (optinal) payload2 = 'https://.......' # image url'(optional)' payload3 = 'message text.........' # in the notifications screen, long press on the image # shows the full image and the text, where you could press the url # to open on Safari instead of open it in IFTTT app url = 'https://maker.ifttt.com/trigger/%s/with/key/%s' % (event, key) # value1,value2,value3 are reserved words in IFTT webhook payload = {"value1" : payload1, "value2" : payload2, "value3" : payload3} headers = {'content-type': 'application/json'} fowardEvent = requests.post(url, data=json.dumps(payload), headers=headers)
-
@cvp That is helpful, but I get no cell reception at my work and no wifi, hence needing bluetooth :/
-
@reticulated <-- I see what you did there. Thank you for the help. I have no wifi or cell reception at work, which is where I'm hoping to use this thing. As for notifications, I was hoping to avoid that by giving Pythonista instructions to buzz when I tell it to... there are commands for making sounds, so I was thinking there might be commands for vibrating too.
-
@tylersuard If at work, you don't have WiFi, you can configure your Raspberry as WiFi HotSpot and connect your iDevice to it...But without Internet, no access to an Internet server like IFTTT.
And almost sure we can't run a Push Notifications local server on the pi š¢