Conversation
|
Goes with meshtastic/protobufs#711 |
|
Progress: now this is working, BUT, there is a small issue that I am not sure how to go around: the serial log shows data is being read in all four channels (ADS1X15 has 4 channels) BUT I don't see all four channels in the received protobuf on our MQTT broker: I think this should be the case, but likely I am missing something silly. Probably the core team can give a hand? |
|
For a quick fix to use both sensors at the same time you could define them as two different labels, ADS1X15 and ADS1X15_ALT and write your module logic in a way it queries both sensors if available. The propler fix would be the change to the sensor map though :-) --EDIT-- disregard, that would require another mapping for the sensor in the protobufs, better go with the reshuffle. |
|
@caveman99 I am having second thoughts regarding this PR... As it feels that it creates a bit of "bloat" on the powermetrics module, for just one chip. Maybe there is another place to put these voltages (something like |
|
I'd put it here. All the values are optional so are not taking up any space if not used.and an 8 channel adc is not an unusual use case ;-) |
|
An additional comment, I had initially inherited the |
|
Just added an additional type to support two sensors in parallel. Without the reshuffle I don't see another option of doing this. This basically creates a new type, and modifies This also needs https://github.com/fablabbcn/protobufs/tree/enhancement/additional-ads1x15-support to work in the protobufs submodule. PR here: #7109 |
6eef108 to
bb828a4
Compare
|
I think this also requires a bit more of testing with two ADCs. Not sure what the issue is. With one, I consistently receive data from it at the right values. I have also used two daisy chained ones at 3V3 (I2C and power) with this breakout from adafruit:
However, when using our own custom board (design here), which uses a step-up to work at 5V with level shifters, I get this: The 12.28V values are due to an overflow on the variables (when too close to 0V), and it also happens on our end. This can ultimately be very easily filtered (and simply considered as 0V). However, I think there is Besides the obvious |
bb828a4 to
7962f51
Compare
|
Rebased onto master |
|
Errrm... how did this get closed? 😓 |
|
Moved to #7404 as I can't reopen now... |
This is a WIP Pull request for the TI ADS1X15 ADCs, discussed in our fork.
I am submitting a separate PR for the protobuf adataptations that need to happen to accomodate for all the channels, but needs discussion (as generally we are interested in having 8 channel, or two ADCs in the same I2C bus), using this board: https://docs.smartcitizen.me/hardware/boards/analog-sensor-board/
Currently this is not working as expected.
I am able to detect and identify the ADS1X15 (note that the default address coincides with another device):
EDIT:
However, when doing the scan in thesetup(): e21d72c#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R693 I don't seem to be able to add the ADC(s) to the sensor list.EDIT:
Initially, I thought this was because there is only onesensorTypeand adding two entries to thenodeTelemetrySensorsMapcreates a conflict: https://github.com/fablabbcn/smartcitizen-meshtastic/blob/e21d72c719c5f6d052bd72394481f7f758dee4b8/src/main.cpp#L1471-L1476. I think this can be a problem (specially with daisy chained sensors). There could be a potential change on the mapping as per this issueHowever, I have also tested a single ADC, and despite detecting it correctly, I don't seem to be adding them correctly to the
nodeTelemetrySensorsMap. Then, once we get here https://github.com/fablabbcn/smartcitizen-meshtastic/blob/e21d72c719c5f6d052bd72394481f7f758dee4b8/src/modules/Telemetry/PowerTelemetry.cpp#L84, its not found.Maybe another pair of eyes can take a look and see where I am making my mistake.
🤝 Attestations