sforkowany z mirror/meshtastic-firmware
bidir comm works
rodzic
f2d7215fb3
commit
ade30ee1ce
2
TODO.md
2
TODO.md
|
@ -1,5 +1,6 @@
|
|||
# High priority
|
||||
|
||||
* check in my radiolib fixes
|
||||
* test raw device access without a manager in the way
|
||||
* sim gps data for nodes that don't have hardware
|
||||
* figure out what is busted with rx
|
||||
|
@ -93,3 +94,4 @@ until the phone pulls those packets. Ever so often power on bluetooth just so w
|
|||
* have meshservice periodically send location data on mesh (if device has a GPS)
|
||||
* implement getCurrentTime() - set based off gps but then updated locally
|
||||
* make default owner record have valid usernames
|
||||
* message loop between node 0x28 and 0x7c
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
../../RadioHead
|
|
@ -13,6 +13,7 @@
|
|||
[env:esp32]
|
||||
platform = espressif32
|
||||
board = ttgo-t-beam
|
||||
; board = heltec_wifi_lora_32_V2
|
||||
framework = arduino
|
||||
|
||||
; customize the partition table
|
||||
|
@ -43,7 +44,7 @@ monitor_speed = 115200
|
|||
# debug_port = /dev/ttyACM0
|
||||
|
||||
debug_tool = jlink
|
||||
; upload_protocol = jlink
|
||||
;upload_protocol = jlink
|
||||
|
||||
; debug_tool = olimex-arm-usb-ocd-h
|
||||
; upload_protocol = olimex-arm-usb-ocd-h
|
||||
|
@ -54,11 +55,13 @@ debug_tool = jlink
|
|||
debug_init_break = tbreak setup
|
||||
|
||||
lib_deps =
|
||||
RadioHead
|
||||
; RadioHead - I now use a custom build of this library
|
||||
; file:///home/kevinh/development/meshtastic/RadioHead
|
||||
TinyGPSPlus
|
||||
ESP8266_SSD1306
|
||||
AXP202X_Library
|
||||
SPI
|
||||
CRC32 ; explicitly needed because dependency is missing in the ble ota update lib
|
||||
Wire ; explicitly needed here because the AXP202 library forgets to add it
|
||||
|
||||
;[env:tbeam]
|
||||
|
|
|
@ -63,6 +63,7 @@ bool MeshRadio::init()
|
|||
// FIXME - can we do this? It seems to be in the Heltec board.
|
||||
rf95.setTxPower(radioConfig.tx_power, false);
|
||||
|
||||
|
||||
DEBUG_MSG("LoRa radio init OK!\n");
|
||||
|
||||
return true;
|
||||
|
@ -77,8 +78,6 @@ ErrorCode MeshRadio::send(MeshPacket *p)
|
|||
ErrorCode MeshRadio::sendTo(NodeNum dest, const uint8_t *buf, size_t len)
|
||||
{
|
||||
DEBUG_MSG("mesh sendTo %d bytes to 0x%x\n", len, dest);
|
||||
// FIXME - for now we do all packets as broadcast
|
||||
dest = NODENUM_BROADCAST;
|
||||
|
||||
assert(len <= 255); // Make sure we don't overflow the tiny max packet size
|
||||
|
||||
|
|
|
@ -74,6 +74,13 @@ void MeshService::loop()
|
|||
}
|
||||
|
||||
fromNum++;
|
||||
|
||||
if(toPhoneQueue.numFree() == 0) {
|
||||
DEBUG_MSG("NOTE: tophone queue is full, discarding oldest\n");
|
||||
MeshPacket *d = toPhoneQueue.dequeuePtr(0);
|
||||
if(d)
|
||||
releaseToPool(d);
|
||||
}
|
||||
assert(toPhoneQueue.enqueue(mp, 0) == pdTRUE); // FIXME, instead of failing for full queue, delete the oldest mssages
|
||||
}
|
||||
if (oldFromNum != fromNum) // We don't want to generate extra notifies for multiple new packets
|
||||
|
|
|
@ -19,6 +19,10 @@ public:
|
|||
vQueueDelete(h);
|
||||
}
|
||||
|
||||
int numFree() {
|
||||
return uxQueueSpacesAvailable(h);
|
||||
}
|
||||
|
||||
// pdTRUE for success else failure
|
||||
BaseType_t enqueue(T x, TickType_t maxWait = portMAX_DELAY) {
|
||||
return xQueueSendToBack(h, &x, maxWait);
|
||||
|
|
|
@ -37,18 +37,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Select which T-Beam board is being used. Only uncomment one. Note: these options now come from platformio standard build file flags
|
||||
#ifdef ARDUINO_T_Beam
|
||||
//#ifdef ARDUINO_T_Beam
|
||||
#define T_BEAM_V10 // AKA Rev1 (second board released)
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
#ifdef ARDUINO_HELTEC_WIFI_LORA_32_V2
|
||||
#define HELTEC_LORA32
|
||||
#endif
|
||||
//#ifdef ARDUINO_HELTEC_WIFI_LORA_32_V2
|
||||
//#define HELTEC_LORA32
|
||||
//#endif
|
||||
|
||||
// If we are using the JTAG port for debugging, some pins must be left free for that (and things like GPS have to be disabled)
|
||||
// we don't support jtag on the ttgo - access to gpio 12 is a PITA
|
||||
#ifdef HELTEC_LORA32
|
||||
#define USE_JTAG
|
||||
//#define USE_JTAG
|
||||
#endif
|
||||
|
||||
#define DEBUG_PORT Serial // Serial debug port
|
||||
|
|
Ładowanie…
Reference in New Issue