could I use pyserial instead of pylibftdi in raspberry pi? - pyserial

currently I develop python program in Windows to control PID controller via package "serial", now I need to transfer everything into Raspberry Pi. I noticed "serial" package could not able to connect the device, even I do see "/dev/ttyUSB0". However, I could use "pylibftdi" to connect PID controller in Pi
python -m pylibftdi.examples.list_devices
FTDI:FT232R USB UART:AM00G1GM
Is there anyway I still be able to connect the device via "serial" package in Pi? So I do not need to change windows code related with serial port. I am confused by the different device reaction between windows and Pi(linux)

Related

How could I make the raspberry pi as a WIFI and ssh module

For a digital design course, we have to use a microcontroller as the CPU of the system. The chip we plan to use is STM32L0C8T6. We want to integrate the SSH function into a keyboard. The way we plan to do it is to connect the STM32 with a Raspberry pi zero or 2 through UART or SPI. The Pi will connect to the WIFI and connect to other hosts through SSH. An LCD display is also connected to the STM32 which will work like the monitor, displaying all things you will see when ssh, like whatever is shown in the terminal when ssh.
My question is how to build the connection between the terminal and STM32. One possible way is to dump everything in the terminal into a file and send the file back to STM32 for display. I think this will be really slow. Are there any better ideas?
The question sounds wired, and I know we could connect LCD directly to the Pi, but this is the project requirement to have to follow. The LCD has to connect to the microcontroller.
Thank you so much!!!!

Raspberry Pi 3+ and MATLAB

I am attempting to connect MATLAB with a Raspberry Pi 3+. Using the application installer in MATLAB, I downloaded and installed the necessary support hardware (https://www.mathworks.com/hardware-support/raspberry-pi-matlab.html) and then used the configuration dialog in those apps to flash a microSD card. Booting the Pi with that card, I set up passwordless sudo and enabled SSH. Using an ethernet cable to connect my laptop with the Pi, I can ping the Pi from MATLAB, and I can SSH in using PuTTy. However, when I try to connect in MATLAB (having opened MATLAB in admin mode), I get the following error:
I'm not sure where to go from here -- this error isn't listed on MATLAB's help page, and I cannot find anything online. Any help is appreciated.
Answer is straightfoward: problem found between user and keyboard. The device address should ONLY be the IP address of the Pi.

IOT Raspberry Pi 3 over no internet

I've worked a tad with IOT on Raspberry pi before, but as a student I ran into a problem and was hoping someone could answer my question. So I need to run Windows IOT Core on the Raspberry Pi 3 (if it was up to me I'd use raspbian or some other flavor of linux, but it's not up to me) and I need to run it at a school who's network I don't have access to. Is there any way of running IOT on raspberry Pi without an internet connection. I had read somewhere that I could buy a router (and even though there was no internet connected to it) I could run ethernet from the router to my laptop and another from the router to the raspberry pi and ssh into the pi from my laptop. Is this true? and how would I go about ssh-ing into the pi? OR is there a better/alternative solution to running IOT with no internet?
You can directly connect Raspberry Pi to your laptop with the network cable. Then the Raspberry Pi will get an IP address. With this IP address, you can either debug app with Visual Studio or connect to the Raspberry Pi via SSH. There are some tools like IoT Dashboard or Device Portal you may need.
For more information about connecting Windows 10 IoT Core, you can reference Windows 10 IoT documentation->Connect your device.

make raspberry appear as SSID

I have a nodejs server in my raspberry and I want people to be able to connecto to it just connecting to the raspi.
The ideal scenario is where in my phone I see the raspi SSID, I connect to it. Then I open chrome enter the ip:port of the raspi itself and it works. Nothing fancier.
What I don't know how to search for in the internet is how to set my pi in a way that it opens itself to the world and appears in the SSID list in my phone. I don't need internet sharing nor anything. Just accessing the nodejs server in the pi.
This can be easily achieved depending on the OS you are using in your pi. Use basically need to use hostapd and a DHCP Server.
You can use a script like create_ap.

UART serial access with Rpi 3

I am trying to establish a serial connection between the RPI3 and an Arduino. Because that wasn't working I connected a USB to TTY cable from my laptop to the Rx/Tx pins of RPI. I was eventually able to use PuTTy to connect to it.
I am running Android Things on the RPI and the android code I have running is supposed to be a loopback (reading from UART and writing back what was read).
Here is where I am confused....
When PuTTy connected I was presented with a command line console on the RPI.
How do I get the Rx/Tx pins on the RPI to just be serial connections into and from my application and NOT a way to log into the console?
Is that a bad idea? I suppose if I ever needed to log into the RPI this would make it more difficult...
I figured out what I was doing wrong...
When following the setup directions at the below site I was using the Bluetooth mode instead of the Application mode. When I followed the directions for Application mode I was able to start using UART0 for serial comms
Set the console attribute to the following in cmdline.txt:
console=tty0
Add the following line in config.txt:
dtoverlay=pi3-disable-bt
Remove the following lines from config.txt:
enabled_uart=1
core_freq=400
https://developer.android.com/things/hardware/raspberrypi.html#disabling_the_console
Beginning with Developer Preview 3, in which USB-Serial devices support added, You can use external USB-UART dongles like this instead of UART of Raspberry Pi 3.