how could monitor device status using raspberry pi - 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.

Related

How to flash without STLINK

My STLINKV2 is not working anymore, not detected by Linux, it failed after the first successful flash. I ordered a new one but it will take 60+ days to arrive. Meanwhile I have heard on Youtube you can program Bluepills directly by connecting cut open USB cable to certain pins and then using a jumper. But I cannot get any precie information on this, is this really possible and how?
You should use the embedded bootloader. You can flash it through several interfaces. Look at AN2606, maybe you can find an already written flasher. Good luck STM32CubeProgrammer handle it.
If you intend to program it through usb, look also at AN3156 all protocols document are referred in chapter 2 of AN2606
THOSE AREN'T CUT OPEN USB CABLES they are USB to serial adapters for arduino's bootloader
They connect them like this:
The problem is that this requires the Arduino STM32 bootloader to be flashed in it.
Another option will be to use STM32CubeProg this program allows you to program your stm over
Serial
SPI
I2C
USB
You'll need to set the BOOT0 and BOOT1 pins to the correct value (HIGH slash LOW) to allow it to go in flash mode during boot.
Here is semi outdated tutorial which tells most of the steps to program a STM using serial. (the Flash Loader Demonstrator is outdated and you should use STM32CubeProg)

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

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.

There is no STM32 chip through the USB driver WIFI module program?

I want to make a network camera, stm32 through the camera to collect images, and then sent to the server through the WIFI module. As 1 second need to transfer a lot of data, so I would like to use the USB interface wifi module program to achieve. Or what better solution to achieve.
Thank you!
I think that you have no idea how the USB works.
You have a couple solutions.
Use a wifi module with SPI interface.
Use a SOC like CC3200.L
Use ESPxxxx module or similar (RTL8710)
You can of course try to use STM with host usb interface, but you will have to implement the USB host stack + driver for USB wifi module + network stack (eg TCP/IP stack). But it is quite complicated as the STM ones are not very good, there are some better paid ones - but expensive. USB host is not easy to implement.
If you want to go along the "networking over USB" path on STM32 (and I'm assuming you're not planning to buy any commercial drivers) it's going to be rough for you.
When it comes to USB, vast majority of the WiFi dongle drivers are proprietary and unless you're on an operating system such as Windows or Linux you're out of luck, unless you want to for the reverse engineering or porting at least parts of the drivers from Linux. With the USB you can think of using the USB-ECM (ethernet over USB) class, but two things here. One - ST doesn't provide any free implementations of this class so you're down do searching for it or implementing it yourself. After a bit of googling I've found one instance of this on githbu, although I havent tested it myself. Second thing - this is no longer wireless as you'll need to be connected to some kind of host providing internet connection, at which point it's probably better to not use USB-ECM and networking at all and just send data using a class that can be implemented easily (USB-CDC or USB-HID). I'm a bit worried about the throughput here.
You can also try to find WiFi modules that are connected over other interface. Generally those modules are connected over UART, some over SPI. This way, integrating it with the TCP/IP stack will also be up to you, at least when it comes to implementing the WiFi module protocol (most likely AT-commands) and implementing network interface so that the stack can "talk" to it. In this approach, I'm almost sure that you'll lack the throughput required for your application.
Personally I'd strongly suggest trying Ethernet if that's an option for you. It's going to be highest bandwidth (which you're going to need), plus it's most "out of the box". There's multiple projects implementing various applications using a free LWIP stack over this interface, including examples generated by ST's CubeMX.

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.

Wireless communication: AVR based embedded system and iPhone

What is the best way to realize wireless communication between an embedded system (based on an AVR controller) and the iPhone? I think there are only two options: either WiFi or BlueTooth. The range is not really a problem, since both devices should stay in the same room.
I have no idea, if there are any useful WiFi boards that can be connected to an AVR based microcontroller system (or any small microcontroller), any hints would be highly welcome.
I guess the better solution would be BlueTooth, but there is also the problem: which BlueTooth board is best suited for attachment to an AVR system, and is it possible to use the iPhone BlueTooth stack for (serial) communication over BlueTooth with the AVR device.
I hope that somebody already realized such a system and can give some helpful tips...
You can get modules for both WiFi and Bluetooth that will connect to an embedded system through a UART interface, however a WiFi module will have far more processing power than your AVR microcontroller, often with spare capacity and I/O to execute additional user code, so connecting one to an AVR maybe somewhat redundant in many cases.
Bluetooth modules are simpler, less expensive, and the data-rate is better matched to the AVR's capabilities. For example these Parani modules. I have used them between an embedded system and a Laptop PC's Bluetooth, so given appropriate communications software, there is no technical reason why it could not be used with an iPhone I think. However this may be the flaw, on the PC the device was recognised as a virtual serial port, I don't know whether iPhone supports 'legacy' communications in quite the same way.
For comparison, a WiFi solution
From what I know, BlueTooth is very limited on the iPhone: There is only very few BlueTooth-Profiles implemented, and - even if they can be extended with a jailbroken iPhone - I doubt this is easy to use from the application layer.
On the other side, transferring via WiFi requires a lot of processing power and memory since much more things have to be implemented before you can even start transferring data: 802.11, cdma/ca, arp, tcp. That's a big task.
Is it an option to build a hardware extension to the iPhone ? You might be able to get the serial connection and power out of the dock connector. Then even ZigBee could be very helpful.
Here's an article you might find helpful. I would lean toward a WiFi solution just because of the added flexibility available.
http://www.embedded.com/design/networking/215801088
-t
Some of the other people at the office have done AVR <- Bluetooth -> Symbian and AVR <- Bluetooth -> PC solutions without trouble. There is lots of info, reference designs and source available. I have no idea of how hard it would be to use Bluetooth on Iphone.
The exact module is probability also not important as long as it got some type of serial interface (I2C,SPI) to interface to the AVR and some source code show how to use the module.
Is it an 8-bit or 32-bit AVR? For the AVR32 processors there's support
for WiFi in the Atmel 1.5.0 Software Framework using SD-card-mounted
WiFi modules from HD Wireless (http://www.hd-wireless.se), including
an IP stack (lwIP). Be aware that you need Ad-Hoc (IBSS) support to
connect directly to the iPhone.
There is WiSnap kit. It can connect directly to a standard RS232 interface or through the TTL UART interface to embedded processors. We are planning to use it in our project. It also has Ad-Hoc support.
There are some usage examples and an iPhone application for connection setup.
http://serialio.com/products/mobile/wifi/WiSnapKit1.php
What are you trying to communicate between your AVR and the Iphone? The Iphone is made for the web along with everything apple (which AVR's are decidedly not). So what works well is an embedded device that exposes a web-interface. Like the Transmission bittorrent client on Linux. Also nowadays many low-power small form-factor linux platforms exist that will allow you to do this.
For instance Gumstix has an ARM based platform that runs linux and includes WiFi (Overo Fire).