Raspberry Pi Zero Embedded - operating-system

First I want to point out that I'm very new to Raspberry Pis. I have bought a Raspberry Pi Zero for my project, because Arduino did not have enough horsepower.
My Project involves an I2C sensor and audio output (I2S). The audio is generated on the Raspberry and that is why I need the computational power.
Now I'd like to know what would be a good choice for the operating system. I don't really need anything else but the I2C and I2S and some math to generate the sound. The project is going to have the Raspberry embedded in the system and is battery powered, so it should be able to survive sudden power loss.
I found something relating to Real Time Operating systems, but I'm not sure if I need it to be exactly real time since I can buffer the generated sound data. But I do need the system to be fast, and as light as possible as the sound generation is rather heavy process.
I understand this is sort of vague question and I'm happy with any information I can get and if you could just point me in the right direction, that would be appreciated.

Related

Olimax STM32-E407 cannot connect over SWD

Good day
The problem:
I am trying to connect/flash/debug a Olimax STM32-E407 dev board over SWD and I am not able
When trying to connect, using CubeProgrammer, I get: "No STM32 Target Found"
What I have tried:
I have connected a ST-link V3 mini to the pinout of the the 20pin header of the Olimax board including 3.3V, GND, SWDIO (PA13/Pin7), SWCLK (PA14/Pin9) and NRST (Pin15).
I am powering the powering the board from a power supply into the power jack
All jumpers and solder bridges are in stock places.
I have also tried manually pulling NRST to ground and doing a full chip erase, but that has not worked either.
I have used these ST-link debuggers on other boards I made and it works perfectly fine
I have 3 Olimax boards and none of them work
Any help would he hugely appreciated.
Debugging problems on microcontrollers have two general common methodes.
Hardware Problems:
In this part, it is highly recommended that use an oscilloscope to monitor circuit.
Make sure the microcontroller is powered with a correct and stable power supply.
Check the soldering quality and there is no short circuit on the board (especially between ground pins and other pins).
Check the NRST pin is high when the board is powered.
Remember that this reset is active low so during programming or debugging this pin should be high. Also, check this pin is debounced with a capacitor.
Also you can check the JTAG pins signals with an Oscilloscope to check if the programmer device is working fine.
Sometimes adding a capacitor between debugging pins and GND increases the bus capacitance and solves the problem. The value of the capacitor should be found by trying.
Software Problems
Check the programmer driver is correctly installed on your PC.
Check the programming method is true(for example maybe the board is designed to be programmed with SWD, not JATG).
Sometimes reducing the programming clock of the programmer solved the problem.
If all of these methods didn't work and you are sure that the board is fine, probably the programmer is broken, so change the programmer with another one.

How do I create a Near Edge computing system? (Send sensor data with Raspberry Pi/DHT11 sensor)

I am working on edge computing for IoT applications and expected to create a system that acts as a near edge computer with the use of a raspberry pi hooked up to a dht11 sensor. How do I send this data over to a computer that is at the edge? Ideally I want to use my PC as this device but I have no clue how to send this data over in real time.
So far I have created the circuit and can view the temperature and humidity readings on the raspberry pi in python. Unsure of what the next steps are - I don't want to send this data over to the cloud just yet.
Side note: I believe i may be missing knowledge regarding this but is the raspberry pi an edge device because it is hooked up to the sensor directly?
Any help is greatly appreciated.
You need to think this through a bit more. What will you do with the temperature and humidity data that you receive?
For example, if you're just experimenting and want to just see the readings in a console on your PC, you can use netcat to send the console output of your Python program from the RPi to PC. No SW development needed, they just have to be in the same network. Not particularly useful for anything else, either.
Otherwise you need to set up some client-server solution between the RPi and your PC. There's a ton of possible solutions, all depending on what you plan to do with the data. You can use MQTT, HTTP, a straight database connection (MySQL, PostgreSQL), etc. You have to supply both sides of the connection. The Python code on client side which connects and sends data; and the server side thing that accepts the samples and stores them somewhere. Plus all the networking, authentication etc.
Or you can just download the Python client libraries for your favourite cloud solution and set that up according to a tutorial. TBH, this sounds a lot less work to me.

How to make Raspberry Pi to be a VoIP ATA Device

I want to make a VoIP ATA (Analog Telephone Adapter) Device using Raspberry Pi, furthermore, I also want to add FXS ports to the Raspberry Pi. Kindly, tell me whether it is possible or not. If Yes, then how?
Here is the
Reference Link
This is probably possible, but not with the Pi alone.
You will need to design and build some external circuitry to convert between telephone line audio (which apparently runs at 48 volts) and audio signals which the Pi can produce. Also it looks like the Pi has no audio input, so you might need to either add a USB audio device or use an analog to digital converter that the Pi has to read the audio signal coming in from the phone line, if it can be polled fast enough.
You might have better luck with a board that has a real microphone jack on it already, instead of the Pi.
Then on the software side you need to attach the audio out, whatever you are using to get audio in, and any circuitry you need to open/close the circuit or send special ring voltages to your VoIP software of choice. Working out how to write that driver code is going to depend heavily on what physical circuit you actually build and what VoIP software you want to have talk to it.
That link above has a design for a line-level audio to phone audio conversion circuit which may help you get started. You could also take the circuitry part of the project over to the Electrical Engineering StackExchange site.

raspberry pi - Why can't I boot the system after shutdown?

I have a raspberry pi 3.
Whenever I want to shutdown, I always execute this command:
sudo shutdown -h now
And I will wait until only the red light is lighting. (And I always remove the power until only the red light is lighting)
But the problem is : every time I shutdown, I can't boot it again. I need to install the OS into the SD card again every time after I shutdown.
If anyone has the same problem ? Please help me. Thanks a lot.
I encountered this after my comment. As I mentioned, I perform the same steps to safely shutdown, unplug, and store.
Based on this page, you might be getting a corrupt SD card. Not sure if any of these apply.
https://www.raspberrypi.org/documentation/installation/sd-cards.md
If you are having trouble with corruption of your SD cards, make sure you follow these steps:
Make sure you are using a genuine SD card. There are many cheap SD cards available which are actually smaller than advertised or which will not last very long.
Make sure you are using a good quality power supply. You can check your power supply by measuring the voltage between TP1 and TP2 on the Raspberry Pi; if this drops below 4.75V when doing complex tasks then it is most likely unsuitable.
Make sure you are using a good quality USB cable for the power supply. When using a high quality power supply, the TP1->TP2 voltage can drop below 4.75V. This is generally due to the resistance of the wires in the USB power cable; to save money, USB cables have as little copper in them as possible, and as much as 1V (or 1W) can be lost over the length of the cable.
Make sure you are shutting your Raspberry Pi down properly before powering it off. Type sudo halt and wait for the Pi to signal it is ready to be powered off by flashing the activity LED.
Finally, corruption has been observed if you are overclocking the Pi. This problem has been fixed previously, although the workaround used may mean that it can still happen. If after checking the steps above you are still having problems with corruption, please let us know.
Hope that helps.
Cheers.
Ian

arduino +odroid (linaru ubuntu with eclipse and opencv) + usb camera

I hope you can help me. I am trying to build a robot but I am kind of stuck. The Arduino Mega is controlling the stepper motors drivers of the robot. The odroid-x is a single board computer that has installed linaro ubuntu and eclipse c++. All the programming is done in C++ and OpenCV is an image processing library.
The odroid-x has only as input a color camera. Therefore, the information from the camera is received and is processed in eclipse. Then, according to the information that is received, the odroid-x should send different integers to the arduino. The arduino should have a program already uploaded in itself, so it will be waiting for an integer and that integer is going to determine what the arduino is going to send to the drivers.
My questions are the following:
How can I do a serial communication between the arduino and the odroid-x?
How can I send information from eclipse to the arduino with a serial connection?
Thanks so much for any guide you can give me
First, be very, very, very careful. The ODROID boards use 1.8V signalling, so hooking up your 3.3V or 5V Arduino to the pins that expect no more than 1.8V will give you a burnt ODROID-X. It is possible to hook these two boards together if you put a level converter between them, and Sparkfun and Adafruit have some of those converters available. There is even a 1.8V reference voltage pin available... one of the pins that go to the LCD panel RGB-to-LVDS converter board puts out a constant 1.8V.
You could use either the four pins of the little white connector, or UART1, as a serial port, or you can use some of the pins in the 50-pin GPIO block as UART4. There are board schematics available on Hardkernel's website. These two UARTs show up as /dev/ttySAC0 (UART1) and /dev/ttySAC3 (UART4).
I don't know how to talk to those UARTs from a program, personally, but I know there are serial communications libraries available for python from watching threads pop up on the ODROID forums.