openradiation / openradiation-mobile

Apache License 2.0
9 stars 3 forks source link

How to add new devices ? #137

Closed ChristianSimonSU closed 5 years ago

ChristianSimonSU commented 5 years ago

Hi,

I developped the device which name was OGCMS. I added some files and adapted them from OGKit, although there maybe upper/lower case issues. The app remains stuck during initialization (device is well detected, connected and turned on).

But the question is larger than this case. If we start to develop a new device, what are the changes to include to get "hwdev" device (for example).

Up to now I identified: openradiation-mobile/src/app/states/devices/ble/device-og-kit.service.ts openradiation-mobile/src/app/states/devices/ble/device-og-kit.ts openradiation-mobile/src/app/states/devices/ble/ble-devices.service.ts

Thanks in advance,

TomDemulierChevret commented 5 years ago

Have you followed the ADD_NEW_SENSOR instructions ?

Are you looking to add a BLE or USB sensor ?

If the app get stuck during a measurement on the initialization phase, the most probable causes are :

ChristianSimonSU commented 5 years ago

I did not even notice there was such instructions 🤦🏻‍♂️ I'll try it and keep you informed.

ChristianSimonSU commented 5 years ago

All right, I did something almost logical: the sensor is virtually the same as OG-KIT1, excepted it's more compact. Therefore, I duplicated every file were I found OG-KIT or named og-kit replacing it with og-cms. Even the tubes and conversion factors are the same.

But I wonder if there is a conflict, since both share the same name begining "og"... especially in device-og-cms-service.ts

ChristianSimonSU commented 5 years ago

One more question: is there a debug mode to investigate the data exchange ? How did you define UUIDs ?

TomDemulierChevret commented 5 years ago

If you launch the app on your phone with npm run run:android then you can debug it with Chrome remote debug. If you go to chrome://inspect/#devices you will see the different Android phone connected to your PC and the web/hybrid app running on them that you can debug.

The UUIDs are set by the bluetooth configuration of the sensor.