django work with a Thermal Printer in Raspberry PI - python

I have a website in django, I only going to visit the website using a Raspberry Pi, I need print a data, and for print I am using a Thermal Printer in the Raspberry Pi.
I can print from the Raspberry pi using
("/dev/ttyAMA0",19200,timeout=5)
for obtain serial communication
This work fine but only when the project is hosting local in the raspberry Pi , but the django project is hosting in a VPS with ubuntu then I have problems for printer from the Raspberry PI.
because in ubuntu there are not
"/dev/ttyAMA0"
How I can work with this thermal Printer from a django project for print correctly using a RaspberryPi

install a print server on the pi and serve the printer. you may need some sort of tunnel so that the VPS can reach the pi.

Related

How to subscribe to a Raspberry Pi Broker in a different network using Mosquitto MQTT?

I did this project
https://diyi0t.com/microcontroller-to-raspberry-pi-wifi-mqtt-communication/
But in that project, the Raspberry Pi is both the Broker and Subscriber. I would like to Subscribe my Raspberry Pi at work, to my Raspberry Pi Broker at home.
I tried making my home Pi a static IP address, but it keeps timing out.
How can I connect from a different network? I just want to be able to run the Python code and receive the readings from the sensor that the Pi at home has.
Thank you.

Send Sensor Data & Stream Video Over Bluetooth (Raspberry Pi to PC)

I would like to send sensor data (string) and live video from the Raspberry Pi camera over Bluetooth. I would like to do this with python. I would like to display the video on the PC in a tkinter window. Any ideas??
Raspberry Pi: Pi 3
PC: Windows 10 with Python 3.8.3 64 bit
Video might be a bit tricky. More details at: https://stackoverflow.com/a/64062680/7721752
Bluetooth on Windows with Python is not that well supported. However, with Python 3.9 there is support for Serial Port Profile (SPP). There is details of how to create the client at: https://stackoverflow.com/a/62815818/7721752
To create the Server on the Raspberry Pi (RPi) I would use the Bluedot library:
https://bluedot.readthedocs.io/en/latest/btcommapi.html#bluetoothserver
(Bluedot only works on RPi)
Developing both ends of a Bluetooth link at the same time is tricky if you are new to creating Bluetooth. My suggestion would be to create the Server on the RPi first and use an app like Serial Bluetooth Terminal on your phone to test it. Once that is working start on developing the client.

Calling Additional Scripts from Arduino-Cli when uploading to a board

I have a Raspberry Pi connected to an Arduino Mini that it normally communicates with over I2C. But I'd also like to be able to reflash the Mini with new code using Arduino-Cli from the Raspberry Pi (kinda rhymes!). This would involve connecting the Raspberry Pi's GPIO serial port to the Arduino's serial port. Additionally, the Arduino Mini requires a manual reset to be applied before its code can be reflashed, which is something the Raspberry Pi can do by toggling a GPIO pin attached to the Mini's reset line. I can do this with a simple Python script. The question is: is there a way for Arduino-Cli to call additional scripts as part of the upload command?

Use uart on Raspberry Pi usb port with Python

im working on a project to connect a Pic to a Raspberry pi via uart.
I know they both have uart pins, but I need to connect them via usb, the cable also serves as the power supply for the Pic.
So my question is, is it possible to use python, C# might also be an option with mono, to use an USB port on the Raspberry Pi for UART?
this is a tutorial I found about uart on the Raspberry Pi with Python
a turorial on what is uart
Not possible.
USB uses two 'pins' for transmission using 'differential signaling'.
This means, both pins are used for sending and transmission.
In UART you use one pin for transmission and one for reception.
Without any interface, not possible.

Connecting Raspberry Pi to Neurosky Mindwave

Has anyone had any luck connecting a Neurosky Mindwave (RF, not Bluetooth) to a Raspberry Pi?
I've tried both python-mindwave and mindwave-python without any luck. I believe it's having trouble connecting through the pyserial module (perhaps because of the way Raspberry Pi sets up the USB inputs?).

Categories