0

Here’s my plan: have a python script running hardware pwm code for a brushless motor im using. The idea is to have an iPhone have an app where 1. The python code can be interacted with to adjust a variable in the code(I’ll be writing my own code for this, I just need the interaction part) and 2. Have the pi with a sense-hat or something equivalent relay data back to the iPhone to create graphs in the iPhone app. I was thinking I could make the pi into its own AP because all this will need to be offline without any internet connection(I can set it up online with the internet and stuff however the implementation for this will require everything to be disconnected from the internet. So: 1. Is there a way to make an iPhone app with a GUI that controls something on the rpi and reads back data from it via PYTHON? 2. Can this be done my making the pi into its own access point and use WiFi or would Bluetooth be a better approach(I’m open to anything)?

Thanks in advance!

P.S I know very little php, JavaScript, Swift, etc. I’m in high school and this is for a project I’m doing, I know my share of python however, but please don’t hold back in your answering! I looked this up a lot and couldn’t find any other question like this. Thank you.

0

I have done something similar via a webpage. I have a python program running 2 threads. One thread monitors sensors and a second thread runs a simple HTTP server that displays the sensor values. The pi connects to my home network and I use port forwarding to allow external access. I use a free DNS service to access the webpage from any device running a browser. Not as neat as an app but gets the job done.

0

I came across this while researching this project myself. Here is a guide to doing it using the MQTT protocol:

https://www.raspberrypi.org/forums/viewtopic.php?t=196010

In short, the Pi can be its own MQTT server, and then the python script can subscribe to notifications sent to an MQTT channel. In the guide, they build an entire iOS app from scratch to send MQTT messages, but I believe there are apps in the appstore that would allow you to connect to enter your MQTT server information without having to build an app from scratch. I'll update when I get to that step.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.