0

I am working on an software application where we can connect the IoT device with mobile phones or laptops using USB for serial communication for following purposes

  1. Using features of IoT device

  2. Configuring IoT device

    2.1) Configure Device HostName

    2.2) Configure Device HostName for mDNS

    2.3) Configure Device WiFi SoftAP SSID/Password

    2.4) Configure Device WiFi Station SSID/Password

    2.5) Configure Device Bluetooth Name

    2.6) Configure Device specific configurations (for example, in case of temperature reporting IoT device we can configure reporting Unit in C or F)

So before I begin with question in details, here are some development boards on which I am focusing on (currently)

  1. ESP8266, ESP32
  2. RaspberryPI (Zero 2 W, 3B+, 4B, etc.)

I will be using Flutter for developing this software application which is installable on mobile phones or laptops

I Could find implementation for USB Serial Communication for Android on Pub.dev. But unfortunately, there is no implementation for iOS, iPadOS, macOS

I am new to iOS development so you can consider that I have zero knowledge of native iOS development using Swift. However I have hands on experience in developing flutter plugin for iOS using basic Swift programming language.

So far I have discovered ExternalAccessory Framework for iOS which also works for iPadOS & macOS

I am aware about MFi Certification, but is it possible to develop app for personal use?

I am looking for Step-by-Step guide for implementing this successfully in my project

I tried ChatGPT for some solutions but I am getting errors in my code...

After reading ExternalAccessory Framework I am still finding it difficult for implementing in my app

Problems I am facing are

  1. I am not experienced with apple development ecosystem
  2. I am not sure whether I am providing permission correctly or not...
  3. I am not sure if the implementation is correct or not...
  • 1
    The external accessory framework only works with hardware that contains a licensed mfi chipset. For personal use, you might be able to use a [cable from Redpark](https://redpark.com/products/serial-adapters/) but this cannot be use for store apps. – Paulw11 May 26 '23 at 21:36
  • 1
    It would probably be easier to configure your iot device over BLE instead of a serial cable. – Paulw11 May 26 '23 at 21:39

1 Answers1

1

As Paulw11 notes, you almost certainly do not want to do this. ExternalAccessory provides access to the iAP2 protocol, which is the kind of serial protocol you're describing, but requires licensing an MFi chip and getting your software verified by Apple. It's expensive and a lot of ongoing paperwork, and it provides far fewer extra features than people assume. It's worth it for some products, but this does not sound like one of them. There is no "hobby" version of MFi.

What you almost certainly want is BLE, which is well supported by iOS, Android, Raspberry Pi, and ESP32.

The ESP8266 doesn't support any kind of Bluetooth. It supports Wifi, so you most often communicate with it over HTTP. In my experience, it doesn't have enough resources to handle TLS, and so I generally haven't found it that practical. The ESP32 is a much more flexible platform to work with.

A popular Flutter package for that is flutter_blue. There are many tutorials online.

Note that asking ChatGPT non-trivial questions will very often give nonsense. It is not designed to write working software. It is designed to write text that looks like working software. It very often makes up interfaces that do not actually exist. In my experience, it is a mistake to ask ChatGPT about things that you are not already an expert in. It's impossible to judge it's response. It might be correct. It might be completely broken. It might be subtly broken in really surprising ways.

Rob Napier
  • 286,113
  • 34
  • 456
  • 610