Codesys V3 and Raspberry Pi SL - How to read values from addresses - raspberry-pi

Good evening.
I have a short question regarding the use of CODESYS Development System V3 and the associated CODESYS Control for Raspberry Pi SL. How do I manage to acquire the values of the connected sensors (e.g. si705x, vcnl) or to write certain bits via the I2C bus? Unfortunately, I cannot find any decisive results or useful documentation for use. With the datasheets of the respective sensors I don't get on either.
Greez

A good worked example, but for another i2c sensor, with code for RPi can be found on this page. Read/learn from this one and you can build your own.

Related

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.

Is it possible to make a flight controller with a non real-time OS?

I've been reading that Raspberry Pi is not suitable for a flight controller because Raspbian (or in my case Windows 10 IoT) is not a real-time OS.
I've read that non real-time OSs are not suitable for critical applications like medical devices, military devices, airplanes, etc.
What is the worst that can happen if I use a Raspberry Pi as quadcopter flight controller? Is it a big deal if the drone reacts to my input a few milliseconds late?
Even Windows 10 does not natively support real-time operation, some third-party extensions may provide developers with the solution they need to take full advantage of Windows 10's capabilities, while meeting their application's real-time requirements. You can search 'Drone Pi: A Windows 10 Raspberry Pi 4G Drone', it is a good sample for flight controller. You can also try to use Arduino + Raspberry Pi as a solution.

how could monitor device status using raspberry pi

I want to build a small project which will monitor some devices(pump,ac etc) status(on/off, current/voltage level etc). I have decided to use raspberry pi 3 as a server. I am thinking about scada. is it efficient to do these works? also i am not familiar to scada. is there anyone to guide me--
where should i start?
what is the suitable software for doing it??
You could just use Python and the RPi.GPIO module to control and monitor the GPIO pins on the Raspberry. Python is powerful, open-script and easy to get into.
You would need to develop a bread-board to protect your Raspberry and allow for monitoring higher voltages.
Some example code on using GPIO with Sockets here: https://github.com/matzpersson/raspberry-gpio-sockets
You may use ScadaLTS on Raspberry.
In ScadaLTS have available modbus protocol among many others.
This is web oriented software with graphics views drag and drop editor.
For now you may read GPIO data programmatically to file and use ASCII File Reader DataSource.
We plan to have datasource dedicated for GPIO.
ScadaLTS based on ScadaBR - fast tutorial https://www.youtube.com/watch?v=JjOQWwoaQuQ.
you could also check out mySCADA. they make a solution for Raspberry pi at http://www.smarthouse.cloud
you can use the GPIO on the Pi or talk to industrial PLC's.

IBM Presence Insight RpiProx

i've been struggling lately with integrating Rasperry Pi and IBM Presence Insight
for wifi proximity detection
the official documentation describes raspberry pi as possible Wifi Proximity sensor, but there is no available documentation
someone tried it before ?
In order to use Raspberry Pi as a proximity sensor, you will need to:
Build a raspberry pi device with two different wifi adapters
Configure one wifi adapter to be an publicly visible endpoint
Write code to capture every time a mobile device tries to connect to the endpoint
Report that information back to Presence Insights.
Unfortunately, the chunk of code you need to write has not been open sourced, so you will need to do this on your own.
You could probably hack together a solution. It looks like there are a lot of resources out there online about "seeing who connects to my network [1], [2]" You could probably use one of these solutions and just feed the data into Presence Insights in the correct format (see the documentation about "proximity connectors.")
[1] http://www.howtogeek.com/204057/how-to-see-who%E2%80%99s-connected-to-your-wi-fi-network/
[2] https://github.com/tlhunter/node-wireless

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.