diff --git a/RemoteIDSpoofer/RemoteIDSpoofer.ino b/RemoteIDSpoofer/RemoteIDSpoofer.ino index 637103c..fca00c2 100644 --- a/RemoteIDSpoofer/RemoteIDSpoofer.ino +++ b/RemoteIDSpoofer/RemoteIDSpoofer.ino @@ -16,6 +16,6 @@ void setup() { void loop() { for (int i = 0; i < num_spoofers; i++) { spoofers[i].update(); - delay(10); + delay(500 / num_spoofers); } } diff --git a/RemoteIDSpoofer/id_open.cpp b/RemoteIDSpoofer/id_open.cpp index 8f0cfd8..64912ac 100644 --- a/RemoteIDSpoofer/id_open.cpp +++ b/RemoteIDSpoofer/id_open.cpp @@ -69,8 +69,12 @@ ID_OpenDrone::ID_OpenDrone() { #if ID_OD_WIFI // scrambled, not poached - for (int i = 0; i < 6; i++) { - WiFi_mac_addr[i] = (uint8_t) (rand() % 16); + // Nodemcu doesn't like certain mac addresses + // setting the first value to 0 seems to solve this + WiFi_mac_addr[i] = 0; + for (int i = 1; i < 6; i++) { + // WiFi_mac_addr[i] = (uint8_t) (rand() % 100 + 100); + WiFi_mac_addr[i] = (uint8_t) (rand() % 256); } memset(ssid,0,sizeof(ssid)); @@ -575,8 +579,6 @@ int ID_OpenDrone::transmit(struct UTM_data *utm_data) { // Pack and transmit the WiFi data. - static uint8_t wifi_toggle = 1; - if ((msecs - last_wifi) >= beacon_interval) { last_wifi = msecs; @@ -783,9 +785,7 @@ int ID_OpenDrone::transmit_wifi(struct UTM_data *utm_data,int prepacked) { odid_message_build_pack(&UAS_data,beacon_payload,beacon_max_packed); if (length > 0) { - *beacon_length = length + 5; - wifi_status = transmit_wifi2(beacon_frame,len2 = beacon_offset + length); } @@ -916,4 +916,4 @@ int ID_OpenDrone::transmit_ble(uint8_t *odid_msg,int length) { /* * - */ + */ \ No newline at end of file diff --git a/RemoteIDSpoofer/id_open.h b/RemoteIDSpoofer/id_open.h index 17f55e6..b0a71ce 100644 --- a/RemoteIDSpoofer/id_open.h +++ b/RemoteIDSpoofer/id_open.h @@ -137,6 +137,7 @@ private: int auth_page = 0, auth_page_count = 0, key_length = 0, iv_length = 0; char *UAS_operator; uint8_t msg_counter[16]; + uint8_t wifi_toggle = 1; uint16_t wifi_interval = 0, ble_interval = 0; uint32_t last_ble = 0, last_wifi = 0, msecs = 0, last_msecs = 2000; Stream *Debug_Serial = NULL; diff --git a/RemoteIDSpoofer/id_open_esp8266.cpp b/RemoteIDSpoofer/id_open_esp8266.cpp index 3a45dfb..3966d78 100644 --- a/RemoteIDSpoofer/id_open_esp8266.cpp +++ b/RemoteIDSpoofer/id_open_esp8266.cpp @@ -161,7 +161,6 @@ int transmit_wifi2(uint8_t *buffer,int length) { #if ID_OD_WIFI if (length) { - wifi_send_pkt_freedom(buffer,length,1); } diff --git a/RemoteIDSpoofer/spoofer.cpp b/RemoteIDSpoofer/spoofer.cpp index 54f06f6..a1bd708 100644 --- a/RemoteIDSpoofer/spoofer.cpp +++ b/RemoteIDSpoofer/spoofer.cpp @@ -43,7 +43,8 @@ Spoofer::Spoofer() { } void Spoofer::update() { - if ((millis() - last_update) < 200) { + // FAA says minimum rate is 1 Hz, we do 2 Hz here + if ((millis() - last_update) < 500) { return; }