I just tried to update a Bean's Firmware from the PTDBean SDK... with lots of guesses and assumptions as there's not much documentation about this... But even if it looks like I went pretty close to the end of the update, the Bean now looks dead
Here is what I did :
First, I embeded the 4 bin files into the App...
Then in XCode:
func beanManager(_ beanManager: PTDBeanManager!, didConnectBean bean: PTDBean!, error: NSError!)
if (error == nil)
let firmwareStatus:FirmwareStatus = bean.firmwareUpdateAvailable("201611070000", error: &error)
if (firmwareStatus == FirmwareStatus.beanNeedsUpdate)
let file1 = Bundle.main.path(forResource: "a_BeanSmallImgAPadded", ofType: "bin")
let file2 = Bundle.main.path(forResource: "b_Bean_imgB_large", ofType: "bin")
let file3 = Bundle.main.path(forResource: "c_BeanSmallImgA", ofType: "bin")
let file4 = Bundle.main.path(forResource: "d_BeanSmallImgB", ofType: "bin")
bean?.updateFirmware(withImages: [file1 ?? "",file2 ?? "",file3 ?? "",file4 ?? ""], andTargetVersion: "201611070000")
This gave this console output:
Offering firmware image 1 of 4: a_BeanSmallImgAPadded.bin
Offering firmware image 2 of 4: b_Bean_imgB_large.bin
Offering firmware image 3 of 4: c_BeanSmallImgA.bin
Device accepted image transfer: 3 of 4: c_BeanSmallImgA.bin
// then later:
Image 3 of 4 uploaded successfully. 92160 bytes, 43.05 seconds, 2140.9 bytes/sec
// then later :
centralManager:didDiscoverPeripheral <CBPeripheral: 0x1700fd500, identifier = EB6AF17A-3863-F6EE-10CD-48F6A781342A, name = Bean update image, state = disconnected>
// then nothing more for a while...
And now the Bean does not respond anymore. Not even the tiny green flash led at power time...
I think I was close to the update, but I did something wrong : can you tell me first what went wrong / what to do next time? And optionally... is my Bean dead forever... ? or is there a trick to get it back to life?
EDIT: no, the Bean was not dead, it appears now back on the Mac OS X BeanLoader, named "Bean update image" and if I try to connect to it, it starts doing (or resuming??) the firmware update... So far I could stop it --> How can I manage the resuming of the update from the iOS app / after the above code ?