First, thank you all for your useful posts. I can usually find what I need from SE without needing to make a post.
I'm hoping to make a timer/sensor device that I can control from a web browser.
I'm planning to hook up a set of sensors by USB or pinouts to a Raspberry pi, then having the Pi host a web server. I have experience writing web servers from scratch in python, so I intend to use python as my programming language for this application as well.
I want to be able to visit the server from another device that will run at a time-keeper's station. By selecting options on the web site, you could control the display portion of the timer or the values of variables (timer reset) also the sensors could trigger update events to show information on the web page.
My primary obstacle in this case is the hardware interface. I imagine I would need to look up how sites like OMSI allow users to control the motors that move their webcam, or other online control of hardware.
What should my search terms be, or do you know of any libraries for python to read and write to external (adafruit-style) sensors?
Thanks!
Anthony
(https://i.stack.imgur./RzWIl.png)
"Raspberry pi python gpio" "Raspberry pi python i2c" "Raspberry pi python spi"
Related
I been looking everywhere online for this exact configuration but can't find much.
I want to program my AtMega328p MCU (its on a breadboard) using Python from my Raspberry Pi 4 but I am not sure how to check if communication is going on between them? I have the MISO, MOSI, SCLK, and CE0 pins from the Pi connected to the MISO, MOSI, SCK, SS pins on the AtMega328p respectively.
I understand I have to use SPI communication, however how can I exactly send data from the Raspberry Pi to the MCU to ensure there is communication between the two? Maybe some code to send to the MCU and receive it back? I been using the SPI Dev Python libraries but can't find much info on it. Thank you in advance!!
To load code onto the AVR (program it), you want to use existing software like avrdude that already speaks the AVR ISP protocol. avrdude already has support for using the RPi SPI headers - just use the linuxspi programmer type.
Here's an article by the author that explains it (although there are probably more recent articles if you search around) http://kevincuzner.com/2013/05/27/raspberry-pi-as-an-avr-programmer/
Is there a reason you want to do this from Python specifically? Or are you referring to communicating between the uC firmware and some Python code on the Pi?
This question is more about advice on how to approach the best solution and possible frameworks to look at.
Desired Result
I am currently attempting to create a very basic plug and play raspberry-pi which can be controlled via an API to perform various tasks such as stream a webcam or turn an led on. The device should connect to anyway wifi and automatically be able to be controlled by the API.
Current Problem
The goal of the app is to create a very easy to use plug and play solution. However I am running to to problem when trying to create a WebSocket on the PI as I cannot seem to be able to access it from an external network. I have looked into automatic port forwarding solutions such as UPnP however all of the results are extremely old. I have also thought about creating the Python WebSocket on a cloud server and use the PI as the client to connect and pass data. Please correct me if I am wrong, however this method does not seem very scalable when there are 10s/100s/1000s of pi's connecting to the same socket.
Any advice would be greatly appreciated.
I need help to setup my project. In particular, my project is a C/C++ project.
This project involves different components that must communicate exploiting Bluetooth Low Energy.
Components:
The components can be classified into two different categories: a mobile component (such as a tablet android or an Ipad) and a raspberry component (a Raspberry Pi W board with a BLE adapter). In the system, there can be 1 mobile component and from 1 to N raspberry components
Desired Behavior:
According to the project requirements, the Raspberry components should notify their presence in order to be detected from the tablet. The tablet has to scan for nearby raspberry and eventually connect to one of the scanned devices. Once the connection is established the tablet has to send at least two strings to the raspberry.
I downloaded the last version of Bluez and I saw the python scripts in the test folder: example-gatt-server and example-advertising. Unfortunately, I have no experience with python. So I looked for an equivalent C code but didn't find anything.
Can anyone help me to find a GATT server in C able to advertise and receive connection request?
Is it correct for my requirements to implement the code for the Raspberry as the one in the gatt-server-example?
Thanks
[EDIT]:
My boss agrees with me to use these python scripts instead of using some C/C++ equivalent. As said before I have no experience using python, so I need some help.
Which types of data are accepted from the gatt-server? Can I pass a string to it?
If I want to modify two of the implemented services (the ones identified using UUID 12345678-....) to pass a string can I do this?
In the gatt-server example, there is a service that seems to deal with the encryption mechanism. If I try to send the string "goofy" is this encrypted, sent and decrypted once received by the gatt-server?
Thanks
I'm new to this forum and relatively new to python but have been playing around with sockets/google app engine/django etc… I'm at a loss on how to best design this app and what tools to use for it. Any people with more exp
Hardware: I have a Raspberry Pi behind a firewall that collects wireless sensor data. I would like to access that data from an outside web server (aka google app engine or ec2 server).
Goal: The goal is to have users in different homes (like my mom, grandpa etc living separately with their own pi's) be able to check their data on the web on a centralized server. I should also be able to initiate actions on the Pi's so the data should be sent bi-directionally. Ideally without having to open up firewall ports (dummy proof).
What I did so far:
I was able to create sockets on the PI to send data to a django server (ec2) but I had to open ports for that.
Questions:
I'd like to do this with python, no open ports, bidirectional data.
How do you deal with failsafes such as:
The internet going down.
Missing server readings.
Power outages.
Could this be solved just by syncing a database between the Pi and web server?
I realize this is a very broad question but perhaps it's less about the exact tools and more about the techniques one would use for this particular type of project? Tools, techniques, paradigms or general experiences are all welcome.
Thanks everyone,
David
I'm looking for ideas, on how to display sensor data in a webpage, hosted by a Synology Diskstation, where the data comes from sensors connected to a Raspberry pi. This is going to be implemented in Python.
I have put together the sensors, and have these connected to the Raspberry. I have also the Python code, so I can read the sensors. I have a webpage up and running on the Diskstation using Python. But how do I get the data from the rasp to the Diskstation. The reading is just done, when the webpage is displayed.
Guess some kind of WebServices on the Rasp ? I have looked at Pyro4, but doesn't look like it can be installed at the Diskstation. And I would prefer not to install a whole WebServer Framework on the rasp.
Do you have a suggestion ?
I'm not experiment on this topic but what I would do is setup a database in between (on the Synology rather than on the Raspberry Pi). Let's call your Synology server, and Raspberry Pi a sensor client.
I would host a database on the server, and push the from the sensor client. The data would be pushed either using an API through webservices or a more low level if you need it faster (some code needed on server side for this) or, since the client computer is under your control, it could directly push in the database.
Your concrete choice between database, webservice or other API depends on:
How much data have to be pushed?
How fast data have to pushed?
How much do you trust your network?
How much do you trust your sensor client?
I've never used it but I suggest you use SQLAlchemy for connecting to the database (from both side).
If in some use case the remote server can be down, the sensor client would store sensor data in some local file and push them when the server come back online.