Yocto Project usb sensor access - linux

I've never worked with the Yocto Project, and barely knows what it is. But I'm investigating the possibility to use a Simatic 2040 as a gateway between an USB hall sensor and industrial PLC network.
The sensor that we want to use is this one. It's designed to use with an Windows desktop PC, connected via USB.
Now my main question is, would it be possible to write software in the Yocto device to capture the sensors data, and share this information with an industrial PLC network.
The industrial PLC network is also Siemens based, so I don't see much problems around that because we can make use of the Node-Red Profinet or Modbus library's.

The question is stated in very general terms, so I will have to answer in very general terms.
Overall the answer to your question is yes, but there are a number of details to sort out (some of them might be show stoppers).
Yocto is a system to generate embedded Linux images and also SDKs (cross compiler toolchain + sysroot).
You might be fine to take an existing Yocto Image for the SIMATIC 2040 and just add your own application to it. For this a matching SDK has to exist. This approach works fine as long as your application has not too many dependencies and you don't need to many modifications off the existing image.
If this is not the case you might be better off generating a custom image as well as an SDK (based on the existing SIMATIC 2040 configuration).
Considering your USB device. The linked data sheet states windows support. Your options?
Talk to the vendor? Does he provide a driver, but doesn't advertise it? Is he willing to hand out a detailed datasheet?
Check if there is a community driver in the mainline kernel?
Reverse engineering the existing Windows driver?
Pick an alternative device with an existing Linux driver (preferably in the mainline kernel).
The right solution depends on the time and effort you are willing and able to put into this.

Related

WebUSB API, for pushing commands/configuration to the device through webApp

I am doing some research on the WebUSB API for our company because we are going to start to manufacture devices in house.
Our current device manufacture comes with an application so the team can plug the device into a computer and diagnose it. Their application allows us to read outputs from the device, as well as pushing commands/configuration to the device over a wired connection.
Since this device is 100% ours, we are also responsible for building out the diagnostic tooling. We need some sort of interface that allows a user to read outputs and send commands/configuration to the device over a wired USB connection.
Is the webUSB the correct API? If not, what are some suggestions for accomplishing the requirement? Are we limited to building some sort of desktop or mobile application?
I would recommend resources below to read to help you understand if the WebUSB API fits your needs or not:
https://web.dev/devices-introduction/ helps you pick the appropriate API to communicate with a hardware device of your choice.
https://web.dev/build-for-webusb/ explains how to build a device to take full advantage of the WebUSB API.
From what you describe, WebUSB isn't strictly required but won't hurt either.
First and foremost, you will need to implement the USB interfaces reading data and sending configurations. It will be a custom protocol, and not one of the standard USB device classes such as HID, video or mass storage. The details of the protocol and if you use control, interrupt or bulk transfers is your choice.
I'm assuming you will connect the devices to Windows PCs, and you likely don't want to put money into writing device drivers. If so, the easiest approach is to add the required descriptors and control requests required for Microsoft OS 2.0 Descriptors. That way, the WinUSB driver will be installed automatically when the device is plugged in.
Using the WinUSB API, a Windows application will then be able to communicate with the USB device. No additional drivers are needed. (On macOS and Linux it's even easier as you don't need the Microsoft OS 2.0 Descriptors in the first place.)
On top of that you can implement the additional descriptors and control requests for WebUSB. It will provide the additional benefit that you can write a web application (instead of a native application) for communicating with the USB device. (Currently, you are restricted to the Chrome browser.) WebUSB devices should implement the WinUSB descriptors as the alternative (.INF files, manual installation process) is a pain.
The already mentioned web page https://web.dev/build-for-webusb/ is a complete example of how to implement it.

Can I retrieve a Windows CE 6.0 image from a hardware device?

Is there a way to retrieve a Windows CE 6.0 image from a working hardware device that uses Windows CE?
This depends on the kind of device you are using.
Many x86-based devices boot from HD/CF/SSD/SD devices that are formatted as regular media devices. You can connect them from a PC and you may be able to find the boot image (you may use nk.bin or a compressed format).
But this is true only if the OEM did not put in place some measures to prevent you from doing that.
For devices that boot from flash accessing their contents is more complicated and, in any case, device specific. Some devices can boot in a different way, allowing you to load a firmware that is commonly used to update images, sometimes it can also recover the existing one, but it's not granted.
Taken for granted that you are trying to do that for legally acceptable reasons, if you can provide a "bigger picture" description of why you need to do that, you may find alternative ways to solve your problem.

Is there a Linux radio standard?

We're about to embark upon implementing a device running Linux that (among other things) will be attached to a software defined FM/AM radio that can also receive RDS data describing playlists and other such stuff. It's a relatively stupid device that mostly contains a DSP or two that act as tuners and otherwise does very little processing of the signal.
I was thinking that kernel drivers for the device and then a userland hardware abstraction layer that provided a standardized interface and abstracted away the details of exactly when the RDS data was received and dealt with error handling and all the other messy stuff. Is there already a userland layer like this? It would be nice to either avoid making it at all, or make our stuff plug-compatible with something that already exists so we could use other projects for the radio UI if we wanted.
Radio support in linux
It sounds like you are creating a new hardware radio device? You'll probably need to build a driver for this device. Some help getting started can be found here, here, and here. If your device is not new, it may already have a driver in the Video4Linux2 project.
It looks like there are some RDS related projects based on the saa6588 kernel module currently.
According to this page, these cards are currently have a SAA6588 chipset:
Terratec Cinergy 600
KNC ONE TV-Station RDS
KNC One TV-Station DVR
TYPHOON TV TUNER CARD RDS
Sundtek MediaTV Pro (supported by the manufacturer)
Sundtek USB FM Radio (FM Transmitter/Receiver, supported by the manufacturer)
RDS specific information
I'd recommend to check out some of the projects related to Video4Linux2 (v4l2), there is an RDS decoding library. This library runs in userspace, so the RDS decoding work can be done there for you:
According to V4L2 specifications, raw data from RDS decoders is read
from the radio device. Data consists of blocks where each block is 3
bytes long. All decoding has to be done in user space.
RDS API
Here is a complete API reference for Video4Linux2. Here is an article series to get acquainted with it.
The particular section for the RDS API is here. This page provides information about how to get an update about whether RDS data is available:
Whether an RDS signal is present can be detected by looking at the rxsubchans field of struct v4l2_tuner: the V4L2_TUNER_SUB_RDS will be set if RDS data was detected.
SDR RDS decoder DSP in Gnu Radio Companion
Although it's not an official API I found one last small project that might be worth looking into:
RDS reception using SDR
Here are some more radio related projects worth looking into.
It may be worth looking into whether the GENIVI consortium (http://www.genivi.org/) has a standard application for this yet. They're developing standards of this sort specifically for automotive "infotainment" purposes, and this seems like it would fall within their area of standardization.
Unfortunately, they don't seem to publish their stuff publicly, so you may need to ask around or send them an email directly.
How about GNU Radio? They have hardware support for lots of software defined radio components, and a data flow easily connected via GUI with their "GNU Radio Companion" (GRC).
They use Python and C++ APIs that can be accessed for your UI layer. There are a number of examples to be found online.

How to get the AT Terminal command log (Linux) from Mobile Partner Modem Software?

I am trying to figure the AT command set issued by the Hauwei's Mobile Partner Software for making voice and video call. Mobile Partner is the bundled software for almost all Hauwei 3G Modems and comes with ability to make and receive voice calls. I need to know the AT commands it issues for my E1732 modem for voice, VIDEO calls and other things.I need the log. I have the Mobile Partner for Linux(Ubuntu) and Windows.It is working in both platforms. So any help in either of the platforms is appreciated.
My aim is to make a Linux based IVR system so I need them.
Thanks for your help
You will want to look at usbsnoop as all these devices are actually emulating serial communication across usb.
Also, have a look at USB modeswitch
homepage
debian repo
Modeswitch packs a lot of vendor specific 'magic' knowledge, that has been obtained by reverse engineering. Of course it was geered towards switching the USB device to 'modem' mode in the first place, but I suspect their developer list will have ample resources on tracing usb traffic.
Also, UMTSMon is Open Source code that allowed me to use several brands of 'unsupported' (undocumented) USB UMTS dongles in the past. UMTSMon will send specific sequences of AT commands if you want. I assume again, that the developer list will help you gather more information.
Disclaimer: I only used the mentioned packages, and have not been involved in their development

Cheap development board for Windows CE

I'm looking for a development board for WinCE, preferably with the following connectors:
VGA/DVI for screen
USB for kb/mouse
Ethernet (10Mbit is OK, 100 would be even better ;-) )
Storage (eg: SD/MMC/CF cards)
I'm looking for this, because I want to attend the Imagine Cup , Embedded Systems design. And I'm looking for a challenge, ofcourse ;-).
I found a board called HawkBoard (http://www.hawkboard.org), but I want to know if there are alternatives for about the same price (max $200 incl. shipping/customs/taxes). I need the BSP, ofcourse ;-).
Thanks!
Yvan
The eBox 2300/3300 is a low cost device that has been used for past Imagine Cup challenges. It's x86, comes with a BSP, is in an enclosure, is low cost ($195 or $255) and meets most of your needs.
Of course CE has forever shipped with a reference BSP for x86, so you can usually get just about any x86 device working, though most other devices tend to be pretty big physically.
There are also open source CE BSPs available for the BeagleBoard and GumStix.
The BeagleBoard is a good ARM system that costs $150. It has all the features you want, from the product page:
DVI-D for connecting digital computer monitors
Compatibility with a huge collection of USB peripherals including hubs, keyboards, mice, WiFi, Bluetooth, web cameras, and much more
MMC+/SD/SDIO interface for memory or wireless connectivity
S-Video out for connecting your NTSC or PAL television or wearable visor
Stereo audio in and out for a microphone and headphones or speakers
Power via typical USB chargers for cell phones from your laptop, from an automobile adapter, from batteries, or even from a solar backpack
I never tried Windows CE myself, but a google search suggests it's possible, and there's even a video on YouTube.
Another option is Gumstix, and there's a project on codeplex to help you get Windows CE on it.
I guess it also depends if you want to start something for fun or rather serious.
Check some of the big manufacturers homepages too, so you can see what specifications could
help the realisation of your ideas or set limits to them.
What helps for shure is if you choose a platform, that can be configured easily and its much more fun if you start with something that can work out of the box too.
Here an example, like you can find it on a lot of manufactureres homepages on the web.
http://www.toradex.com/En/Products/Colibri
Colibri modules feature state of the art technology, and aimed at low power systems that require high CPU performance. They are equipped withall the interfaces needed in a modern embedded device.
Colibri T20 features include:
· Dual Core ARM Cortex A9 Processor
· 2 x 1.0GHz Processor Speed
· Full HD 1080p Video (Encode / Decode)
· Powerful 3D Rendering Performance
· True Dual Display
· Up to 12 Megapixel Camera Sensor Support
And if this is to much there are Colibri modules in the family which are in a lower price range with adapted specifications that might fit you needs better.
What I personally think is important, that you know that you can get good support and talk to the right people in person as well.
Give it a shot and good luck.
Regards
Any old PC that has a video adapter that is VESA compliant and a network adapter based on NE2000, realtek RTL8139 or 3COm 3Cx5 can be used as Windows CE target device using the CEPC BSP.
If you have an old 486 or more powerful PC lying unused somewhere in your garage, it's time to resurrect it! :)

Resources