Closed shawnchain closed 4 years ago
I think fixing network device as "en0" in NetworkInfo.cpp is not good idea. Please consider why referring routing table to determine default interface. Can this code produce your-wanted result with WiFi enabled Mac that attached USB-Ethernet adapter?
I am not familiar with developing on macOS, but I heard that it is a family of BSD based OS. I think this code (on Gist) would help what should be fixed.
https://gist.github.com/etodd/d8184b91c02306b889c13eb03f81fb6d
(Recently I added FreeBSD support code to NetworkInfo.cpp and issued pull-request. I hope this code also help you.)
And do you know what NetworkInfo.cpp is used for? Currently this is used for I2C-based OLED and UART-based Nextion LCD display. They are used by MMDVM Hotspot and displayed IPv4 address is for remote-login web/SSH console.
If you do not have any plan to connect these display devices, I think there is no need to add support code...
en0 under mac os would be the WiFi network interface and I think this is the simplest way to retrieve ip address and most of the time it works (unless we disable the wifi and plug a usb/thunderbolt3 NIC wire). As to the OLED display ,I could drive it under mac os, but that's another story related to the MMDVM firmware.
Wow! It may be off-topic (sorry), but I am interested in how you modified ArduiPi_OLED. Can you tell me what adapter you used for connecting OLED to Mac? It will be good hint for me to do same thing with Banana Pi board that runs OpenBSD (it can not drive I2C device from userland through /dev/iic).
@shawnchain can you test this diff?
(please apply this to my recent NetworkInfo.cpp at https://github.com/jg1uaa/MMDVMHost/blob/630551f6fd76af806d20c5fab1f7c156f0a654d7/NetworkInfo.cpp )
I dropped the ArduiPi_OLED code and enables I2C drv inside MMDVM firmware, also modify the MMDVMHost protocol to pass-though the OLED/I2C commands directly. What you need is to modify the MMDVM modem board to expose the I2C pins and connect to your OLED driver. Also lot's mods required both on Host and Firmware.
Can this be fixed with the updated NetworkInfo.cpp please.
some improvement for mac os