Skip to content
Advertisement

Yocto Project usb sensor access

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.

Advertisement

Answer

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?

  1. Talk to the vendor? Does he provide a driver, but doesn’t advertise it? Is he willing to hand out a detailed datasheet?
  2. Check if there is a community driver in the mainline kernel?
  3. Reverse engineering the existing Windows driver?
  4. 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.

Advertisement