scratux / scratux

A simple project that aims to provide Free/Libre Open Source Linux binaries of Scratch Desktop
https://scratux.org/
BSD 3-Clause "New" or "Revised" License
103 stars 19 forks source link

porting Scratch Link to Linux #15

Open camyrland opened 4 years ago

camyrland commented 4 years ago

will it be possible to port Scratch Link https://github.com/LLK/scratch-link to Linux as part of this project? Letting users connect the BBC Micro.bit and Lego EV3/WeDo to Scratux would be a major boost.

joancipria commented 4 years ago

Hi @camyrland! There's already a port on https://github.com/kawasaki/bluepy-scratch-link that seems to be working (it connects successfully with Scratux). Unfortunately I don't have any Micro.bit or Lego EV3 to test it. If you can test it please give me some feedback so we could include it in the project as an easy to use extension. Definitely it would be a great feature ;)

camyrland commented 4 years ago

Wow, that's great @joancipria ! I'll give it a try later today and will report back on how it works. I only have micro:bit at my disposal right now, but I have access to Lego EV3 and WeDo as well, so I'll try to get my hands on them later in the week.

camyrland commented 4 years ago

@joancipria, so I've done a mini-test. The bluepy-scratch-link program creates a certificate for Firefox and Chrome, and it actually works. I'm sitting here right now with a microbit programmed from Scratch over bluepy-scratch-link.

But, sadly, it doesn't work with Scratux. I figure this is because bluepy-scratch-link doesn't know about Scratux and doesn't make a certificate for it...

Also, bluepy-scratch-link is way too inaccessible for kids as it is right now. It should be packaged, and preferably rolled together with Scratux, so that it "just works" when you add microbit/lego libraries to Scratux... But at the very least it should be available to major distros as a binary.

Sadly, that is way beyond my knowlegde, but I might be able to find someone who can help - if you're interested and want help doing it, that is :D

joancipria commented 4 years ago

Sad, I thought it could work. I will try to make it work with Scratux and then try to figure a good way to integrate it with the project. Thank you su much @camyrland for the suggestion, maybe I would need your help for testing

camyrland commented 4 years ago

@joancipria sure, just let me know if you need something. Have you been in touch with the maintainer of bluepy-scratch-link? I took a look at the code and I figure it shouldn't be very difficult to add Scratux to the certificate generator: https://github.com/kawasaki/bluepy-scratch-link/blob/master/gencert.sh

joancipria commented 4 years ago

Yes, I've just opened an issue. I don't think it's a certificate problem since It looks like connection is established, but I'm not sure. Let see if what the maintainer can give us some information so we can make it work.

joancipria commented 4 years ago

@camyrland I've find this node js version of scratch-link which could be easier to implement in Scratux. Could you please test it with your Micro.bit?

I've needed to replace the first line of the get_certificates.sh from #!/usr/bin/bash to #!/bin/bash to make it work. Then:

./get_certificates.sh node app.js

camyrland commented 4 years ago

@joancipria tried it, but got this: https://pastebin.com/drHqFYbF

joancipria commented 4 years ago

@camyrland try with npm install before node app.js

camyrland commented 4 years ago

@joancipria hmm, got this: https://pastebin.com/XZannf5T

camyrland commented 4 years ago

Tried running "node app.js" again, got this: https://pastebin.com/GH9jCXWt

Looks like I'm getting closer to something...

camyrland commented 4 years ago

Oh me be silly. I forgot to run ./get_certificates.sh facepalm

camyrland commented 4 years ago

Wellllll, app.js runs, and the dummies ROBOT and MBOT appears in both scratch and scratux, but not the real micro:bit. I'll try to poke around some more later..

pepo-k commented 3 years ago

Hello, I have a problem to establish a stable connection to lego boost module. My set-up: Lego Boost + NUC PC D34010WYK with dualboot ubuntu 20.4 and win 10.

Under Win10 I have installed scratch and also scratch link. There I could get connected stable to lego boost and from scratch drive all motors and also optical interface on lego boost.

Under Ubuntu I have installed scratux and also scratch link (as advised on https://pypi.org/project/pyscrlink/). I can not say if scratux over scratch link is working at all, as my problem starts at very beginning. When pairing in bluetooth, I get it on, but in a few seconds later is once again off and the lego boost auto-switches off. Below the output from terminal while trying to connect. And also the output from hci. Please help me, I can not find the solution by myself.

home@ubuntu:~$ bluetoothctl Agent registered [bluetooth]# pair 00:16:53:A5:14:EC Attempting to pair with 00:16:53:A5:14:EC [CHG] Device 00:16:53:A5:14:EC Connected: yes [CHG] Device 00:16:53:A5:14:EC ServicesResolved: yes [CHG] Device 00:16:53:A5:14:EC Paired: yes Pairing successful [CHG] Device 00:16:53:A5:14:EC ServicesResolved: no [CHG] Device 00:16:53:A5:14:EC Paired: no [CHG] Device 00:16:53:A5:14:EC Connected: no [CHG] Controller D8:FC:93:70:00:B6 Discoverable: no [bluetooth]#

home@ubuntu: hciconfig -a hci0: Type: Primary Bus: USB BD Address: D8:FC:93:70:00:B6 ACL MTU: 1021:5 SCO MTU: 96:6 UP RUNNING PSCAN RX bytes:2592 acl:30 sco:0 events:163 errors:0 TX bytes:6262 acl:26 sco:0 commands:124 errors:0 Features: 0xff 0xfe 0x0f 0xfe 0xdb 0xff 0x7b 0x87 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH HOLD SNIFF Link mode: SLAVE ACCEPT Name: 'pepuntu' Class: 0x1c0104 Service Classes: Rendering, Capturing, Object Transfer Device Class: Computer, Desktop workstation HCI Version: 4.0 (0x6) Revision: 0xe00 LMP Version: 4.0 (0x6) Subversion: 0xe00 Manufacturer: Intel Corp. (2)