15 ms·
Ask HN: Sensor emulation for your physical machines
At iotify.io we enable emulation for I2C/SPI based sensors with virtualized hardware, such as TMP105, HCSR04, ADS111x etc. One of the possibility is to enable such sensor emulation also on real hardware such as your linux desktop machine or a physical raspberry Pi.
The idea is to install a mock SPI/I2C driver on your machine and emulate the sensor you would like develop software for, by running our emulator program.
Off course there will be certain limitations here in terms of speed and accuracy of emulation, however for general programming purpose this would be fairly accurate and cut down your software development time drastically.
Would that be interesting for you somehow? Would love to know your thoughts.
- antoinealb 9y ago> however for general programming purpose this would be fairly accurate and cut down your software development time drastically. Having written drivers for that kind of sensors I would rather use automated tests (unit & integration). Maybe you could explain why your approach is better than just using mocks ?
- aagosh 9y agoSure, One immediate benefit I could see is the independence of hardware board (even those without any controller). You could run and schedule automated test on VM, without instrumenting your code. This is more relevant for System tests and integration. Also since we emulate transactions at bus layer, it works more accurate rather than software tests. We recently found a bug in a driver where it had a hardcoded time to wait for response, instead of waiting for interrupt status. Such a thing would work in real hardware but fails on our simulated tests. Last but not least, sensor manufacturer could provide more accurate models of device behavior through our software which could then be tested against compensation values applied in your driver.