Page 1 of 2

Sept 2015 Scratch release

Posted: Tue Sep 29, 2015 5:19 pm
by timrowledge
With the new 'jessie' Raspbian comes a new Scratch. There'll be more extensive documentation appearing soon but the two headline items are
a) speed; the VM & image is now a Squeak Cog/Spur system. This means roughly 5x faster execution of non-graphics operations; remember we sped up the graphics a while ago. Anyone for Asteroid Blaster at 150fps?
b) a new built-in gpio server. It doesn't replace the socket based broadcasting so all of Simon's and Gerhard's work is still supported - indeed, it opens new options for cross-machine collaboration. It is a first pass at making a very simple to setup and use device driving framework and I hope to make big improvements based on your experiences playing with it.

Re: Sept 2015 Scratch release

Posted: Tue Sep 29, 2015 7:28 pm
by bfinio
Where should we look out for the more extensive documentation? I asked about the GPIO documentation in a comment on the blog post and got this response from Simon Long:

"Scratch in this release includes a new GPIO server, which allows broadcast blocks to be used to set GPIO state and sensor blocks to be used to read GPIO state. I’ll have a look to see if this is documented in a useful fashion anywhere…"

but from some quick Google searching, I'm not really clear if there's a single centralized location for documentation about new RPi Scratch releases.

Re: Sept 2015 Scratch release

Posted: Wed Sep 30, 2015 1:55 am
by timrowledge
I've provided a big chunk of info to the folk at Pi Towers and it ought to appear somewhere soon - perhaps even as tomorrow's blog if we're lucky. Meanwhile if you look at the Scratch examples directory (just hit the Examples shortcut in the file open dialogue) at the Motors and Sensors folder then you should see a group of new example projects named gpio-*. They should illustrate the basics decently -and if not, let me know so I can improve them!

Re: Sept 2015 Scratch release

Posted: Wed Sep 30, 2015 10:35 am
by abee
Hi, Tim
Thank you for your great work. The NuScratch seems works fine.
However Japanese translation files (ja.po and ja_HIRA.po) are degraded to very very old version.
I maintain those files on the MIT's Scratch translation server.
http://translate.scratch.mit.edu/ja/scratch1.4/ja.po
http://translate.scratch.mit.edu/ja_HIR ... ja_HIRA.po
Could you update them?
Thank you for your help.

Cheers,
Kazuhiro Abe

Re: Sept 2015 Scratch release

Posted: Wed Sep 30, 2015 5:05 pm
by timrowledge
I'm sorry to hear that - I'll add them to the list to fix!

Re: Sept 2015 Scratch release

Posted: Sun Oct 04, 2015 11:06 pm
by mob-i-l
I tested Scratch 1.4 (Linux) 2015-09-15 in Raspbian Jessie and there is a bug concerning variables in the editor: when one adds a local variable (For this sprite only) and have no other variables before, one doesn't get the commands set, change, show, hide. If one creates a global variable one gets these commands.

Re: Sept 2015 Scratch release

Posted: Tue Oct 06, 2015 7:21 pm
by timrowledge
Huh; well that *is* odd. I wonder how long that has been happening. After making a sprite variable, a global variable and another sprite variable it all seems to sort itself out, which is even odder.

Opened as https://github.com/raspberrypi/scratch/issues/151

Re: Sept 2015 Scratch release

Posted: Wed Oct 07, 2015 11:25 pm
by timrowledge
timrowledge wrote:I've provided a big chunk of info to the folk at Pi Towers and it ought to appear somewhere soon !
... and there it is. https://www.raspberrypi.org/blog/a-new- ... dded-gpio/

Enjoy. Make suggestions.

Re: Sept 2015 Scratch release

Posted: Thu Oct 08, 2015 12:36 am
by plugwash
Did you come to some agreement with the MIT guys about the trademark?

Re: Sept 2015 Scratch release

Posted: Thu Oct 08, 2015 9:08 pm
by Fjl
Is it possible now to use RPi serial port on GPIO14 & GPIO15 with new Scratch commands?

I'm thinking abut easy way to send commands to Ciseco XinoRF through Ciseco Slice of Radio that is connected to that serial port.

It was done using Python PySerial library like this: http://openmicros.org/index.php/article ... -part-2#19

Re: Sept 2015 Scratch release

Posted: Fri Oct 09, 2015 3:21 pm
by iw1
I like the improvements. Thank you.
I've only found one problem so far. When I 'save picture of scripts' the file that's generated shows an error when I try to display it: "GIF file was missing some data (perhaps it was truncated somehow?)".
I suspect this will be a trivial problem to fix.

Re: Sept 2015 Scratch release

Posted: Fri Oct 09, 2015 7:31 pm
by GeekTeacher
Hi, is it possible to upgrade the Scratch suppiled in Wheezy to the new version with gpio support? Any details of how to install it appreciated.

Re: Sept 2015 Scratch release

Posted: Fri Oct 09, 2015 7:43 pm
by ShiftPlusOne
GeekTeacher wrote:Hi, is it possible to upgrade the Scratch suppiled in Wheezy to the new version with gpio support? Any details of how to install it appreciated.
Could you please run

Code: Select all

sudo apt-get update
and then provide the output of

Code: Select all

apt-cache policy nuscratch

Re: Sept 2015 Scratch release

Posted: Sat Oct 10, 2015 12:06 pm
by Michael_O
[Copied from blog comments at Tim's suggestion]

This is all great news and the speed increases are very impressive. I have some queries about the motor control however. It looks as if this is only provided through one of the supported add-on boards? I have been using Simon’s ScratchGPIO for a good while now and there are two features I hope can be implemented easily in the new Scratch.

The first is stepper motor control which is very useful. I drive a stepper motor through a ULN2803 chip directly from the GPIO pins. It would be great if I could do this in the new Scratch.

The second point is more technical. PWM is often fixed at 100Hz or higher and this is fine for things like dimming LEDs but when you want to control DC motors the frequency becomes important; at low power factors such motors simply stall. The solution is to run them at more like 10Hz so that the motor is getting decent bursts of power and it is possible to control down to a few revs per second. I contacted Simon about this last year and he re-wrote the interface to reduce the frequency when power is below 20%.

Is it possible to add these in the new Scratch or if not is it possible they will be implemented sometime? I think they are both very useful for anyone wanting to control models or robots.

Michael

Re: Sept 2015 Scratch release

Posted: Sat Oct 10, 2015 4:37 pm
by dmoss
ShiftPlusOne wrote:
GeekTeacher wrote:Hi, is it possible to upgrade the Scratch suppiled in Wheezy to the new version with gpio support? Any details of how to install it appreciated.
Could you please run

Code: Select all

sudo apt-get update
and then provide the output of

Code: Select all

apt-cache policy nuscratch
If this is useful, this is what I get when I run that code...

nuscratch:
Installed: 20150114-1
Candidate: 20150916
Version table:
20150916 0
500 http://archive.raspberrypi.org/debian/ wheezy/main armhf Packages
*** 20150114-1 0
100 /var/lib/dpkg/status

Re: Sept 2015 Scratch release

Posted: Sat Oct 10, 2015 5:20 pm
by ShiftPlusOne
dmoss wrote:If this is useful, this is what I get when I run that code...

Code: Select all

Installed: 20150114-1
Candidate: 20150916
The system hasn't been kept up to date. You occasionally need to run:

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade

Re: Sept 2015 Scratch release

Posted: Sun Oct 11, 2015 11:11 am
by iw1
A minor problem, also found when saving picture of scripts...
In the 'Save Scripts Window' there are 3 folder option icons. Clicking either 'Compute' or 'pi' (current user) open up the appropriate folder but clicking on 'Desktop' opens up the current user's home folder (i.e. same effect as second option) not the desktop folder. The windows for other filer operations have the same 'feature'.

Re: Sept 2015 Scratch release

Posted: Mon Oct 12, 2015 11:19 pm
by timrowledge
Fjl wrote:Is it possible now to use RPi serial port on GPIO14 & GPIO15 with new Scratch commands?
Well, sorta-kinda. The PiLite is currently supported and that uses serial comms via gpio pins BUT it also requires some rather involved config stuff on your Pi.

For some sort of general serial support I'd need more info on sensible setups and I'd have to work out a usable framework for scripting it. Consider it on the list but please don't hold your breath!

Re: Sept 2015 Scratch release

Posted: Mon Oct 12, 2015 11:24 pm
by timrowledge
iw1 wrote:I like the improvements. Thank you.
I've only found one problem so far. When I 'save picture of scripts' the file that's generated shows an error when I try to display it: "GIF file was missing some data (perhaps it was truncated somehow?)".
I suspect this will be a trivial problem to fix.
Hmm, that's odd.
a) it used to work and nothing has been changed in that area
b) the gif opens perfectly well on my iMac
c) the gif opens perfectly in another Squeak system

So I'm forced to the conclusion the Raspbian provided image viewer has an issue :-)

Re: Sept 2015 Scratch release

Posted: Mon Oct 12, 2015 11:38 pm
by timrowledge
Michael_O wrote:[Copied from blog comments at Tim's suggestion]The first is stepper motor control which is very useful. I drive a stepper motor through a ULN2803 chip directly from the GPIO pins. It would be great if I could do this in the new Scratch.
Ah, but you can do that yourself and it should be trivial. You have full control over the pins; you (almost certainly) don't need any special driver at all. The caveat is that you may be speed limited when using a script to do it all. Depends. You can easily drive a Ryantek motor board direct from the gpio as well, for example.
Michael_O wrote:The second point is more technical. PWM is often fixed at 100Hz or higher and this is fine for things like dimming LEDs but when you want to control DC motors the frequency becomes important; at low power factors such motors simply stall. The solution is to run them at more like 10Hz so that the motor is getting decent bursts of power and it is possible to control down to a few revs per second.
So you'd want a way to set the pwm frequency? I *think* wiringPi can support that. Hmmm... looks plausible.

Re: Sept 2015 Scratch release

Posted: Tue Oct 13, 2015 12:07 am
by timrowledge
iw1 wrote:Clicking either 'Compute' or 'pi' (current user) open up the appropriate folder but clicking on 'Desktop' opens up the current user's home folder (i.e. same effect as second option) not the desktop folder.
Good grief, so it does. That's a trivial typo that's been there a long time. I'll fix it ...

Re: Sept 2015 Scratch release

Posted: Tue Oct 13, 2015 4:22 pm
by iw1
timrowledge wrote:
iw1 wrote:I like the improvements. Thank you.
I've only found one problem so far. When I 'save picture of scripts' the file that's generated shows an error when I try to display it: "GIF file was missing some data (perhaps it was truncated somehow?)".
I suspect this will be a trivial problem to fix.
Hmm, that's odd.
a) it used to work and nothing has been changed in that area
b) the gif opens perfectly well on my iMac
c) the gif opens perfectly in another Squeak system

So I'm forced to the conclusion the Raspbian provided image viewer has an issue :-)
Not quite so straightforward as this unfortunately. LibreOffice on both a Pi and a Windows 7 computer will also load the gif saved from the version of Scratch supplied with Jessie but, like the Raspian image viewer, Microsoft ImageViewer won't display it, neither can it be inserted into a Microsoft Word document, an error being reported. Microsoft Paint will load it but with a black background.
Whereas a gif produced using 'save picture of scripts' in Scratch 1.4 of 14-Jan-15 (running under Wheezy) will load into any of the programs mentioned above, including the Jessie image viewer, without error though there is also a black background in Microsoft Paint.

Re: Sept 2015 Scratch release

Posted: Tue Oct 13, 2015 6:43 pm
by ghp
Hello,
the gif problem seems to be some sort of interop problem. Found an exported gif working with
- GIMP 2.8.2
- Internet explorer 11
- firefox 41
- inkscape 0.9.1
- vlc media player 2.2.1
- irfan view 4.38 shows background black, but in options this can be changed to display transparency.
- libreoffice 4.4.5
- chrome browser 45

IMHO (0.1) the gifs are ok.
Regards,
Gerhard

Re: Sept 2015 Scratch release

Posted: Thu Oct 15, 2015 12:20 am
by timrowledge
ghp wrote:the gif problem seems to be some sort of interop problem.
Oh dear. Well there's another bug to work on; I guess the library used for exporting images has been 'improved' somewhere.

Re: Sept 2015 Scratch release

Posted: Fri Oct 16, 2015 6:56 pm
by ghp
Hello
think there are no gif-problems.
IMHO the gifs are ok.
It is also possible to import the script-gif to a sprite.
Regards,
Gerhard