Update 0.2.0.0009

Here we are again with a new update  :#

I am pleased to announce that we finally have support for the Photon Wifi driver! 

All you have to do to use it is:

from drivers.wifi.bcm43362 import bcm43362 as bcm
from wireless import wifi

bcm.auto_init()
<br>and then you can use sockets, http, network scan and even select! You can find additional info in the docs and you can also clone a few examples (under drivers). Additionally, every example based on the CC3000 can be used with the Photon by changing the import of the driver, the network interface remains the same (cool, isn't it?).<br><br>One important note (and the reason for the delay in the update): Broadcom drivers are closed source, a developer can get them but can't distribute them. Therefore Broadcom drivers are included in a precompiled form (as a C library). The good news is that now Viper can dinamically link against object code<br><br>There are also some bug fixes here and some minor improvements.<br><br>As usually, please help us improving Viper by reporting bugs and issues with the update.<br><br>Thank you all from the Viper Team!<br><br>P.S.<br>If, for unfathomable reasons the update breaks your Viper, you can dowload the 0.2.0.0008 installer from here:<br><ul><li><a rel="nofollow" target="_blank" href="http://download.viperize.it/full/Viper-0.2.0.0008.dmg">Mac</a></li><li><a rel="nofollow" target="_blank" href="http://download.viperize.it/full/ViperInstaller-0.2.0.0008.exe">Windows</a></li><li><a rel="nofollow" target="_blank" href="http://download.viperize.it/full/Viper-full-linux64-0.2.0.0008.tar.xz">Linux</a></li></ul>

OK here are my results on OSX (El Capitan): I can viperize a Particle Core (white) and Photon. But I cannot upload a program. After pressing RESET and waiting for 1-2 seconds the LED will flash red, and the IDE reports “attempt x” (until x=39)  but will finally say: "Can’t open board @ 
[UPLOAD]: ooops, uploading failed with the following error: Can’t open serial!"
I have restarted my iMac to no avail. 

mmm…this sound as a El Captain issue.

Can you please test the following?

- close Viper
- edit Viper.app/Contents/Resources/ide/ide/viperusb.py
- at line 333, change “IOUSBDevice” to “IOUSBHostDevice”
- restart Viper and test the Photon

going to update my Mac as soon as I get back home…

Hi to all,
I've a problem with NUCLEO F401RE and OSX El Capitan. When I plug USB the board not appear on the menu. I've fixed the problem like Giacomo said.
Admin can you create a new discussion like: OSX El Capitan fix problem?

Giacomo said:
mmm...this sound as a El Captain issue.

Can you please test the following?

- close Viper
- edit Viper.app/Contents/Resources/ide/ide/viperusb.py
- at line 333, change "IOUSBDevice" to "IOUSBHostDevice"
- restart Viper and test the Photon

going to update my Mac as soon as I get back home...


Environment: Windows 10
Viperized my Photon.
Uploaded Photon Wifi Scan example, did not work.
Tried to restore my Photon firmware - failed with screen showing numerous python errors.
Photon now bricked.
Can you tell me how to get my Photon back, please?

Further to my last post:
Restore Viper IDE 0.2.0008
Was able to restore Photon firmware.
Looks like an issue with 0.2.009

Giacomo said:
mmm...this sound as a El Captain issue.

Can you please test the following?

- close Viper
- edit Viper.app/Contents/Resources/ide/ide/viperusb.py
- at line 333, change "IOUSBDevice" to "IOUSBHostDevice"
- restart Viper and test the Photon

going to update my Mac as soon as I get back home...

Same here on OSX: after this change I do not see the Photon in the board list. 

Further to my last post:

It would appear that the browser cache causes issues.

After I had installed 0.2.0.0009 I had a number of issues when I tried uploading.

I cleared the browser cache using CCleaner (free version available via the web).

I also change my cache settings from Automatic to Check every Visit.

Things got better.

I can now run the ViperApp Basic and WifiScan -Broadcom examples OK.

The Photon talks to the wifi! !! Hurrah.

I still haven't managed to restore the Photon original firmware. Get the following meassage:

Error restoring firmware Fatal Error TRACEBACK FOR negative count:: Traceback (most recent call last): File "C:\\Program Files\\Viper\\ide\\ide\\vipercontrol.py", line 919, in dispatch getattr(self,msgtype)(msg) File "C:\\Program Files\\Viper\\ide\\ide\\vipercontrol.py", line 357, in viperize res = board.restore() File "C:\\Program Files\\Viper\\ide\\ide\\boards\\photondfu.py", line 36, in restore return self.burn(bin) File "C:\\Program Files\\Viper\\ide\\ide\\boards\\photondfu.py", line 25, in burn bin=bin+bytes(130*1024-len(bin)) ValueError: negative count

Will explore why.

I think we need some clear guidance on browser cache settings as this could save users reporting other issues as a result..

Oh a Photon board, what are the approximate flash and RAM resources available to the user python programs?

The photon vm is around 70k of flash. Of the total 1mb, the particle bootloader is preserved together with the first 16k of flash after it. Since photon flash blocks are 128k each a rough estimate  is that only the first 256k are used, the rest is free for bytecode. If you are interested, under the viper installation folder in ide/boards you can open the photondfu.py and look at the actual flash layout with adresses and segments. 

As for ram, the photon vm takes up probably 8k (last time I checked) but there is room for a lot of optimisation, for example by not statically allocating serial buffers… 
If you use the gc module you can get the amount of free memory, but that’s not the memory used by the vm itself, just vm plus the python script. 

thanks for the info