Merge pull request #119 from cyberman54/development

Cayenneport fixed
This commit is contained in:
Verkehrsrot 2018-07-22 18:23:49 +02:00 committed by GitHub
commit 79a012999e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 34 deletions

View File

@ -56,7 +56,8 @@
#define CONFIGPORT 3 // Port on which device sends gps query results #define CONFIGPORT 3 // Port on which device sends gps query results
#define GPSPORT 4 // Port on which device sends gps query results #define GPSPORT 4 // Port on which device sends gps query results
#define BUTTONPORT 5 // Port on which device sends button pressed signal #define BUTTONPORT 5 // Port on which device sends button pressed signal
#define CAYENNEPORT 2 // Port for Cayenne LPP 2.0 packet sensor encoding #define LPP1PORT 1 // Port for Cayenne LPP 1.0 dynamic sensor encoding
#define LPP2PORT 2 // Port for Cayenne LPP 2.0 packed sensor encoding
// Some hardware settings // Some hardware settings
#define RGBLUMINOSITY 30 // RGB LED luminosity [default = 30%] #define RGBLUMINOSITY 30 // RGB LED luminosity [default = 30%]

View File

@ -221,12 +221,14 @@ void PayloadConvert::addStatus(uint16_t voltage, uint64_t uptime,
float celsius) { float celsius) {
uint16_t temp = celsius * 10; uint16_t temp = celsius * 10;
uint16_t volt = voltage / 10; uint16_t volt = voltage / 10;
#ifdef HAS_BATTERY_PROBE
#if (PAYLOAD_ENCODER == 3) #if (PAYLOAD_ENCODER == 3)
buffer[cursor++] = LPP_BATT_CHANNEL; buffer[cursor++] = LPP_BATT_CHANNEL;
#endif #endif
buffer[cursor++] = LPP_ANALOG_INPUT; buffer[cursor++] = LPP_ANALOG_INPUT;
buffer[cursor++] = highByte(volt); buffer[cursor++] = highByte(volt);
buffer[cursor++] = lowByte(volt); buffer[cursor++] = lowByte(volt);
#endif
#if (PAYLOAD_ENCODER == 3) #if (PAYLOAD_ENCODER == 3)
buffer[cursor++] = LPP_TEMP_CHANNEL; buffer[cursor++] = LPP_TEMP_CHANNEL;
#endif #endif
@ -253,7 +255,6 @@ void PayloadConvert::addGPS(gpsStatus_t value) {
buffer[cursor++] = (byte)((alt & 0xFF0000) >> 16); buffer[cursor++] = (byte)((alt & 0xFF0000) >> 16);
buffer[cursor++] = (byte)((alt & 0x00FF00) >> 8); buffer[cursor++] = (byte)((alt & 0x00FF00) >> 8);
buffer[cursor++] = (byte)((alt & 0x0000FF)); buffer[cursor++] = (byte)((alt & 0x0000FF));
} }
#endif #endif

View File

@ -9,9 +9,10 @@ void senddata(uint8_t port) {
ESP_LOGI(TAG, "LoRa busy, data not sent"); ESP_LOGI(TAG, "LoRa busy, data not sent");
sprintf(display_line7, "LORA BUSY"); sprintf(display_line7, "LORA BUSY");
} else { } else {
LMIC_setTxData2(PAYLOAD_ENCODER == 4 ? CAYENNEPORT : port, LMIC_setTxData2(
payload.getBuffer(), payload.getSize(), PAYLOAD_ENCODER <= 2 ? port
(cfg.countermode & 0x02)); : (PAYLOAD_ENCODER == 4 ? LPP2PORT : LPP1PORT),
payload.getBuffer(), payload.getSize(), (cfg.countermode & 0x02));
ESP_LOGI(TAG, "%d bytes queued to send on LoRa", payload.getSize()); ESP_LOGI(TAG, "%d bytes queued to send on LoRa", payload.getSize());
sprintf(display_line7, "PACKET QUEUED"); sprintf(display_line7, "PACKET QUEUED");