Fixed ram/psram display. memGet.h wasnt needed as we can call this directly from ESP
This commit is contained in:
parent
7d4c5739ce
commit
f02380a0b4
@ -43,14 +43,14 @@ And place the follow code AFTER the above lines:
|
||||
|
||||
```cpp
|
||||
// Display memory usage using the MemGet class
|
||||
uint32_t freeHeap = memGet.getFreeHeap();
|
||||
uint32_t totalHeap = memGet.getHeapSize();
|
||||
uint32_t freeHeap = ESP.getFreeHeap();
|
||||
uint32_t totalHeap = ESP.getHeapSize();
|
||||
uint32_t usedHeap = totalHeap - freeHeap;
|
||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 4, "Heap: " + String(usedHeap / 1024) + "/" + String(totalHeap / 1024) + " KB");
|
||||
|
||||
// Display PSRAM usage using the MemGet class
|
||||
uint32_t freePsram = memGet.getFreePsram();
|
||||
uint32_t totalPsram = memGet.getPsramSize();
|
||||
uint32_t freePsram = ESP.getFreePsram();
|
||||
uint32_t totalPsram = ESP.getPsramSize();
|
||||
uint32_t usedPsram = totalPsram - freePsram;
|
||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 5, "PSRAM: " + String(usedPsram / 1024) + "/" + String(totalPsram / 1024) + " KB");
|
||||
```
|
||||
|
14
meshmqtt.py
14
meshmqtt.py
@ -305,9 +305,17 @@ class MeshtasticMQTT(object):
|
||||
data.ParseFromString(message_packet.decoded.payload)
|
||||
logging.info('Received telemetry:')
|
||||
|
||||
data_dict = {key: value for key, value in data}
|
||||
print(data_dict)
|
||||
|
||||
data_dict = {}
|
||||
for field, value in data.ListFields():
|
||||
if field.name == 'device_metrics':
|
||||
text = clean_dict({item.name: getattr(value, item.name) for item in value.DESCRIPTOR.fields if hasattr(value, item.name)})
|
||||
if text:
|
||||
logging.info(text)
|
||||
else:
|
||||
data_dict[field.name] = value
|
||||
|
||||
logging.info(data_dict)
|
||||
|
||||
if getattr(data, 'device_metrics'):
|
||||
text = {
|
||||
'battery_level' : getattr(data.device_metrics, 'battery_level'),
|
||||
|
Loading…
Reference in New Issue
Block a user