Update 0.2.0.0008

Finally!

Version 0008 is out.

First, the most important thing: you won’t get this update via the Viper IDE update mechanism…because it has been rewritten to be more reliable :stuck_out_tongue: . Please uninstall your Viper IDE and download it again from here.

A lot of new features have been added (in order of coolness):

  • An Exception Debugger and a Bytecode Explorer. The console can now recognise printed exceptions and with a click of the mouse the exception traceback is shown. If you don’t use the Viper IDE console for debug, don’t worry: just copy and paste the exception text in the exception debugger and you will get the traceback. All of this, at the cost of just 8 more bytes per Viper thread.
  • The Viper App! Go get it here and start playing with the included examples
  • Wifi. The wifi module together with the CC3000 driver module and an almost BSD compliant socket implementation will let you write compact scripts to access the internet.
  • HTTP. The first version of Viper requests module is ready, with a basic but very easy to use implementation of the http protocol
  • JSON & MsgPack. Serialize and unserialize your objects
  • Udoo sopport! yes! thanks to all the users who provided invaluable feedback.
  • Hardware timers and advanced PWM. The hwtimers module provides a non-polling sleep with precision in the microseconds. And the pwm module now provides a blocking version of the pwm.write that produce exactly the amount of pulses you decide.
  • Infrared. Pwm, icu and hwtimers are used together in the infrared module to code and decode infrared signals. Go play with the TOI shield!
  • Servo motors. A module for servo motor controlling coupled with an animator module (an abstract and easy to use frame interpolator) f
  • SPI. A module to handle spi communications with sensors and actuators directly from Python.
  • Uplinkable resources. You can now create html, json, txt, bin files and save them together with the bytecode on the board flash. Open them from Python as read-only files!
  • Virtual boards. You can now compile your scripts without a board plugged in

…and I probably forgot something  :slight_smile:

See you soon with the Photon wifi drivers and I2C
Thanks for your update. I tested with "UDOO Dual". Board will detected and the Python script run on UDOO.
Before i have uninstall and new install the VIPER IDE.
But the VIPER IDE stopped with this message:
[UPLOAD]: ooops, uploading failed with the following error: Wrong VM version! Expecting [0.2.0.0008] found [None]


root@udoo-debian-hfp:/home/debian/udoobridge# python udooviper.py
------------------------------------------------------------
Viper <----> Udoo Serial Bridge
------------------------------------------------------------

Advertiser started...
--- TCP/IP to Serial redirector --- type Ctrl-C / BREAK to quit

Waiting for connection...
Connected by ('192.168.178.35', 49401)
Disconnected
Waiting for connection...
-----------------------------------------------------------------------------------------------
Hello Viper!
[PROJECT]: Project Blink can't be saved to cloud: 
[PROJECT]: Here is your project Blink
[COMPILER]: Compiling VIPER code for udoo
[COMPILER]: Compiling module [__main__]
[COMPILER]: Compiling module [__builtins__]
[COMPILER]: Compiling module [__main__]
[COMPILER]: Compiling module [__builtins__]
[COMPILER]: Everything Done!
Opening board...
attempt 0
connecting to ('192.168.178.26', 7777)
Board found
Probe sent
[UPLOAD]: ooops, uploading failed with the following error: Wrong VM version! Expecting [0.2.0.0008] found [None]

Hello Rickor,

What operative system are you using? Have you viperized the Udoo before uplinking? Here are the steps by steps instructions http://doc.viperize.it/0.2.0.0008/board_udoo.html#udoo

my system is Windows 64bit and i have read the instructions.
I haved [VIPERIZE]: Viperizing…

[VIPERIZE]: Enjoy your viperized board!

But there are two settings in VIPERIZE
-Viper VM - codename Anita - 0008 rev 3
-Viper VM - codename Anita - 0.2.0.0008
I tested Viperize with both but the same error.

Same problem on OSX.

Viperizing has become problematic (with version 0.2.0.0008) with a Particle Core (both Black and White) and a Particle Photon.
The first attempt gives an error (device not found), second or third attempt will say that the board is viperized. The board list will indicate “viperizable”, but not “viperized” when it is done like it used to.
Even when the Particle Core White or Photon are successfully viperized, uploading a program gives the error mentioned above (“Expecting [0.2.0.0008] found [None]”). 

The Black Core cannot be viperized at all, see: https://community.viperize.it/discussion/35/fixed-particle-core-cycling-shown-and-hidden-in-the-board-list-after-viperized#latest

So unfortunately 0008 is unworkable for me :frowning:


mmm…weird.

The “viperized” state has been removed because it can’t be reliably established on all supported platforms (read: Windows breaks things  :expressionless: ).

Apart from that I can’t replicate your issue. Can you confirm that, after you start the uplink and the photon is reset, the led blinks red?

Only thing I can think about is that the new firmware release from Particle broke something in the Photon VM. I’ll start investigating about it.


When the Photon is turned on (I mean attached to USB) the LED flashes red quickly for about 4 secs. 
When a program is uploaded the led does not light up. This is shown:

################################################################################
#       Please RESET your Particle Photon in the next 5 seconds
################################################################################

Opening board…
attempt 0
Board found
Probe sent
[UPLOAD]: ooops, uploading failed with the following error: Wrong VM version! Expecting [0.2.0.0008] found [None]


PS if I choose the “V” button, -> the viperize dialog shows (but I do not click the blue viperize button yet). 
I put the board in DFU mode, press “viperize” button, I get the error “no such device” in red. 

If I change the order:
Put board in DFU mode, press V button, press Viperize button. Result: success. 

Then after a successful viperization uploads work or you still get the: Found [none] error?

i tested again with UDOObuntu 1.1 before UDOO Debian the same error


connecting to (‘192.168.178.26’, 7777)
Board found
Probe sent
[UPLOAD]: ooops, uploading failed with the following error: Wrong VM version! Expecting [0.2.0.0008] found [None]
floyd said:
Then after a successful viperization uploads work or you still get the: Found [none] error?
That is correct.

You mean it works?

floyd said:
You mean it works?
No, I get the Found [none] error.

Photon/Core Viperization issue
@mjm, I can reproduce the “no such device issue”, and that’s because the correct way to viperize is to first put in dfu mode, select the Viperizable board and then hit vperize. The IDE can be misleading about this process, I’ll change it in the next update.

found [None] 
Still checking, I can’t reproduce on any platform

Udoo
@RickorDD are you able to try Udoo with a different Viper distro (Linux or Mac)? I smell something wrong with windows sockets…It goes like this: the ViperBridge was working flawlessy on Linux and Mac, but when I tested it on Windows I found that Windows to Udoo communication was sometime so slow that the IDE couldn’t find the VM. Increasing the duration of startup phase of the VM solved the issue, and so the update includes that fix. Maybe the duration is not enough on some machines, or the bug lays elsewhere… 

I’l keep you posted

The Viper release mail mentioned “uninstalling” Viper. I just overwrote viper.app with the new one (this is on OSX). Is there more uninstalling to be done perhaps?

mjm said:
The Viper release mail mentioned "uninstalling" Viper. I just overwrote viper.app with the new one (this is on OSX). Is there more uninstalling to be done perhaps?
mmm...usually OSX does the right thing when overwriting (unless you overwrote with an opened Viper IDE in the browser)...and everything related to the virtual machine is in the app; projects and configuration are in the Documents folder and I can't think of a way for them to create such issue. 

Can you try the manual way to check if a working VM is on the Photon? Reset it, open a console to it with the Viper IDE or with another serial terminal, and while the led is blinking red, type a "V" (capital v). It should answer with the VM header.
Giacomo said:
mjm said:
The Viper release mail mentioned "uninstalling" Viper. I just overwrote viper.app with the new one (this is on OSX). Is there more uninstalling to be done perhaps?
mmm...usually OSX does the right thing when overwriting (unless you overwrote with an opened Viper IDE in the browser)...and everything related to the virtual machine is in the app; projects and configuration are in the Documents folder and I can't think of a way for them to create such issue. 

Can you try the manual way to check if a working VM is on the Photon? Reset it, open a console to it with the Viper IDE or with another serial terminal, and while the led is blinking red, type a "V" (capital v). It should answer with the VM header.
As I said: the led off. Only after resetting the Photon I see a red led for about 4 seconds. After that the led is off.
But when I reset the board, the board becomes unselected in the IDE (seems logical). But then I cannot open a terminal. So it eludes me want you want me to do exactly.

This is correct. When you reset the board, the usb connection is also reset and the OS need to re-discover the device.
After a couple of seconds you should see a message on the bottom left corner of the ide: Board list updated.
Then you can reselect your photon from the list and upload your script or open the console.

We tried today with OSx Yosemite and the viperization and upload procedures on photon always worked.
D.

i checked with Debian 8 Live CD but crashed

user@debian:~/Viper$ ./viper.sh
/home/user/Viper/sys/linux64/git/git-remote-https: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
Exception in thread Main Loop:
Traceback (most recent call last):
  File “/home/user/Viper/ide/ide/viperserver.py”, line 250, in run
    git, gcc = vtools.check_tools()
  File “/home/user/Viper/tools/tools.py”, line 226, in check_tools
    okgcc,out = runcmd(tools[“gcc”][“arm”][“gcc”],"–version")
  File “/home/user/Viper/tools/tools.py”, line 202, in runcmd
    return (0,subprocess.check_output(args,universal_newlines=True,cwd=cwd,shell=shell,startupinfo=startupnfo,input=datain,timeout=timeout))
  File “/home/user/Viper/sys/linux64/python/lib/python3.4/subprocess.py”, line 607, in check_output
    with Popen(*popenargs, stdout=PIPE, **kwargs) as process:
  File “/home/user/Viper/sys/linux64/python/lib/python3.4/subprocess.py”, line 859, in init
    restore_signals, start_new_session)
  File “/home/user/Viper/sys/linux64/python/lib/python3.4/subprocess.py”, line 1457, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/Viper/sys/linux64/gcc/arm/bin/arm-none-eabi-gcc’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File “/home/user/Viper/sys/linux64/python/lib/python3.4/threading.py”, line 920, in _bootstrap_inner
    self.run()
  File “/home/user/Viper/sys/linux64/python/lib/python3.4/threading.py”, line 868, in run
    self._target(*self._args, **self._kwargs)
  File “/home/user/Viper/ide/ide/viperserver.py”, line 301, in run
    traceback.print_exc()
NameError: name ‘traceback’ is not defined

SAVING DB {‘tutorials’: {‘first-project-anon’: 0, ‘browse-projects-anon’: 0, ‘board-plugged-logged’: 0, ‘new-project-anon’: 0, ‘board-plugged-anon’: 0, ‘first-project-logged’: 0, ‘reminder-anon’: ‘1441376865’, ‘new-project-logged’: 0, ‘browse-projects-logged’: 0}, ‘first-time’: 0, ‘theme’: ‘light-dark’, ‘stats’: True}
main:INFO>> Bye! False
The Killer is started
viperthreads:INFO>> Shutting Down Http Server
viperthreads:INFO>> Shutting Down Stats Listener
viperthreads:INFO>> Shutting Down Parse Backend
viperthreads:INFO>> Shutting Down Device Listener
viperthreads:INFO>> Shutting Down Websocket Server
viperserver:INFO>> Killing open WebSocket Handlers
viperthreads:INFO>> Waiting Stats Listener
Closing!!
viperthreads:INFO>> Killed Stats Listener
viperthreads:INFO>> Waiting Parse Backend
viperthreads:INFO>> Killed Parse Backend




floyd said:
This is correct. When you reset the board, the usb connection is also reset and the OS need to re-discover the device. After a couple of seconds you should see a message on the bottom left corner of the ide: Board list updated. Then you can reselect your photon from the list and upload your script or open the console.

We tried today with OSx Yosemite and the viperization and upload procedures on photon always worked.
D.

I found the cause of the "Found [none]" problem. It is a user error compounded by confusing messages from the IDE. When uploading a program to the Photon, it seems I pressed the SETUP button instead of (or together with) the RESET button. This will make the IDE show the regular messages (Opening board... attempt 0...Board found) but it will then fail with "[UPLOAD]: ooops, uploading failed with the following error: Wrong VM version! Expecting [0.2.0.0008] found [None]". It would be nice if the IDE would recognise this user error. I guess more users will have thick fingers like myself. 

In the course of solving the above problem I wiped the Viper app and the Viper folder in my Documents folder (on OSX; I hate that location!). I redownloaded the Viper app and reinstalled. Started the app, which offered to redownload my projects. This failed for all projects. 
I then logged out of the app and restarted. Tried to redownload projects: success. Looks like a bug to me.