sjstein / tpMonitor

Python monitor script to connect to tpServer
0 stars 0 forks source link

7 mock ms5837 ba sensor #27

Closed carlofazioli closed 4 years ago

carlofazioli commented 4 years ago

I've created the pull request because I think the additions are sufficient.

I was able to manually import the mock sensor into a python shell and verify that each method that is called by tpServer.py will return a (seemingly) reasonable value.

I then added a --debug command line arg to use when calling python tpServer.py. When absent, the server is launched as before. When present, the mock sensor module is imported in place of the BlueRobotics module, allowing the rest of the server code to run without further modification.

However, as anticipated there is some (platform dependent?) code in the call to get_ip_address(b'eth0') so at the moment I can't carry out further tests.

carlofazioli commented 4 years ago

OK, a quick scan of the ip link show output on my machine tells me that my ethernet device is called enp4s0. Works well! See screenshot.

Should we modify the tpServer to accept a device name CL arg, with a default of eth0?

Screenshot from 2020-05-15 08-26-51