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

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!!!!

Related

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.

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.

Passive WiFi detection system using WiFi router

As part of my project requirement I want to make a system which will detect all the WiFi devices in my router range either its connected or not, I did some research on it then I found something like wireshark ,kismate etc I just tried the wireshark by making my Mac machine's WiFi as an adhoc network and its all fine I am able to list all the WiFi devices in wireshark, now I want to make a real-time system based on a real WiFi router I don't know how I will configure my router using my PC and how I will monitor the router from my PC , one more thing if I am using this wireshark how I will use this data for my requirement. If any one worked with similar scenarios please help me..thanks in advance
To do that you will need more than the usual API that you have on commercial WiFi routers (by that I mean a full SSH access). I would:
flash my router with OpenWRT (you can search for your router on this page for detailed instructions)
Install the aircrack-ng suite on the flashed router with
opkg update
opkg install aircrack-ng
Put my WiFi card in monitor mode and run the airodump service:
airmon-ng start wlan0 #Put your NIC in monitor mode
airodump-ng mon0 #Sniff surrounding packets
You don't necessarily have to install aircrack-ng, you can just put your card in monitor mode using command line (look at the documentation for your WiFi driver) and then run tcpdump (command line equivalent to wireshark) but aircrack works very well and has a nice format.
Also, I should warn you that you can brick your router by flashing it. I never had such a problem when flashing router mentioned on the OpenWRT wiki and there are (most of the times) ways to restore a bricked router depending on the brand but I am not responsible if you break it ;)

How to Stream data over TCP to a Windows 7 laptop?

Im acquiring data from a sensor using RaspberryPi. Now the idea is to get the data streaming over an ethernet link to my Windows 7 laptop and do the monitoring and recording on the laptop. Can I get some advice on how to implement this in C/C++.
The idea is to get the signal from a sensor streamed to a Windows GUI.
You can push data from your raspberry PI to you Windows
You can have some sort of service on your Windows box and your raspberry PI can push information to your software running on your Windows.
or
you can pull data from your raspberry PI to you Windows
In this case, raspberry PI would be a passive provider and Windows would ask for data.
Hard to give you more information without more details but basically you decide who is going to the passive and active and program that way.
I personally would request data from the raspberry PI to Windows as I can have my service running and just update when I need instead of having my service running and suddenly have my data changing.
That said, it's hard to say without more details.
You need to tell what kind of programming language are you going to use.
According to your question, you need to dig into socket programming.
Recently,I linked my two Raspberry-Pi by writing a python script to establish a TCP connection between them.
and there is this protocol called "RTSP(Real Time Streaming Protocol)" to (as the name says) stream data in real-time.
(If you are to use python , there is this module called gst-python for streaming).
I think the above infos would give you where to start.