JopieK

Powered Up - A tear down...

Recommended Posts

15 hours ago, Lok24 said:

The one which allows 2 sensors or 1 sensor and one 1 boost-motor attached has  version 01 10

The one which allows only one sensor has version 03 10

Which reads as Version 1.0.01 and 1.0.03. The latter seems to be the version after connecting to the PuP app, at least the Android version I've got does this. I've got a bunch of "fresh" Smart Hubs which I will check, too.

15 hours ago, Lok24 said:

I did it with my RasberryPi!

That is my target platform, too. The RPi will run the main program, will control the large TV display with the track schematics, a small, local display showing all the technical status information (like battery levels), and will also control a bunch of Arduino Nano "slaves" that each control up to two motors, a bunch of sensors, and some LEDs.

Now, nothing for the squeamish: I'm going to buy a bunch of 8870 Power Functions LEDs, just to butcher them. The two LEDs with their cable get small DuPont connectors so I can drive them (with an 820 ohm resistor) from an Arduino's pin, the PF cable and connector get a larger DuPont connector and will be used to drive PF motors over a MOSFET bridge. I can run up to two motors and eight LEDs from an Arduino Nano+MOSFET bridge combo for way less than 10€, and can hook up to 64 of them to the controlling RPi.

Share this post


Link to post
Share on other sites
7 hours ago, treczoks said:

I can run up to two motors and eight LEDs from an Arduino Nano+MOSFET bridge combo for way less than 10€, and can hook up to 64 of them to the controlling RPi.

Was thinking about something similar some time ago. No time/and only have basic skills to do that - my plan was to just power some locos with custom board and to try motorized switches.

How do you plan on communicate between nano and rpi? And, most importantly, why nano (not saying it surprises me, just asking) ?

Share this post


Link to post
Share on other sites
Just now, Bartosz said:

How do you plan on communicate between nano and rpi? And, most importantly, why nano (not saying it surprises me, just asking) ? 

I simply use the UART over USB. Plain text commands. One key problem I found early on is which /dev/ttyUSBx is which Nano (Linux renumbers them more or less arbitrary after a boot - but so does windows), but that's easily solved: I use three analog in ports on the Arduino, and tie them either to GND, VCC, or to 1/3 VCC or 2/3 VCC. Which gives me two bits per pin. So each Nano has it's individual ID of six bits set by hardware. The Nano plus the LEDs can easily be fed from USB power, and for that I can use the four ports of the RPi 3B+. The BT and Wifi is already on board and don't eat up USB slots. If I ever need more - up to 64 - Nano boards, I can use USB hubs.

I use the Nano because it is dirt cheap and small. I don't need a big or fast brain for this. The software is a stupid "read command from UART and execute" thing, so the Nano is more than sufficient. I can also use a 5m USB cable without problem to control the Nano, as it's USB2 and not that sensitive.

In parallel to the USB, I've got a 9V (actually 10V, but it does not hurt) power line that I feed into the MOSFET bridge for the motor. The Nano is somewhere in the 4-5 € range, the Bridge is about 3-4 €, so the complete controller for one of my modules is well below 10€. The whole show is run from a power supply with 10V/20A for the motors and 5V USB/3A for the RPi.

Sometimes, I use a Nano as a standalone system e.g. for running LEDs. I power them through USB, as it is readily available, and if I don't have a 220V socket available for the wall wart, I can easily use a power bank instead - it contains enough power to run our Classic Space launch pads for a week, even if I cannot recharge it.

Share this post


Link to post
Share on other sites
On 1/18/2019 at 8:29 PM, Mr Hobbles said:

Not sure what exact functionality you're looking for, but [0x03, 0x00, 0x02] seems to force a disconnect from the hubs side

So I kinda just discovered the official protocol from Lego!

And I found what I was looking for there: more than a disconnect, a power off:

[0x03 0x00 0x02 0x01]

Adding that 0x01 specify a clean power off. So no chance to reconnect again if you are still listening.

Share this post


Link to post
Share on other sites
23 hours ago, Cosmik42 said:

So I kinda just discovered the official protocol from Lego!

And I found what I was looking for there: more than a disconnect, a power off:

[0x03 0x00 0x02 0x01]

Adding that 0x01 specify a clean power off. So no chance to reconnect again if you are still listening.

Ah good, glad you found something! I am still trawling through that document and adding support for various features to my library. :)

I do wish it was more detailed into the various commands that can be sent to the various attached devices. While it does a pretty good job of detailing the protocol, it mentions very little about sensor modes and message parsing, special motor control modes (ie. swing mode), etc.

Share this post


Link to post
Share on other sites

So at the Toy Fair today Lego has announced a new Technic LIEBHERR R 9800 excavator set containing a new app controlled system called "TECHNIC Control+", and including "7 motors and 2 smart hubs". My thoughts:

1. Probably an extension of Power Functions 2.0 (WeDo 2.0/Boost/Powered UP/Duplo trains)

2. 7 motors and 2 smart hubs = A new 4 port smart hub? This could be the Boost move hub, but I think it's more likely they've created a new one with four external ports and made it more "Technic'y" as opposed to "System'y" like the Boost hub.

3. "Data feedback". Interesting. Are the motors tacho motors (Like the Boost motor) that report angle rotation? Not quite sure what they mean by this yet.

4. They mention "real life sounds". While I'm holding out a little hope that the new smart hub has an inbuilt speaker, I think it's more likely it comes out of the smartphone with the app.

3. That's gonna need a LOT of batteries!

EDIT: Apparently there is also a Technic "Extreme 4x4" containing two motors, a servo motor, and a hub. So a new motor! :D

Edited by Mr Hobbles

Share this post


Link to post
Share on other sites

Seems that the new Hub has the app. format of a EV3 Brick, and hopfully will use 6 AA
Some rumors talk about two integrated moros, but I can't believe.

As the Boost-Hub is called "Move Hub" I think it is different.
And with all known LEGO applications sound comes from the tablet.

And anything other than the PF 2.0 technique would be insane.

We'll have to wait.....

PS: first is confirmed:
- new Hubs
- looking like EV3-bricks
- no integrated Motors
- integrated tilt sensor
- Connections like Boost/PoweredUp
- Servo-motor

 

Edited by Lok24

Share this post


Link to post
Share on other sites
36 minutes ago, Lok24 said:

Seems that the new Hub has the app. format of a EV3 Brick, and hopfully will use 6 AA
 Some rumors talk about two integrated moros, but I can't believe.

As the Boost-Hub is called "Move Hub" I think it is different.
And with all known LEGO applications sound comes from the tablet.

And anything other than the PF 2.0 technique would be insane.

We'll have to wait.....

PS: first is confirmed, new Hubs, integrated tilt sensor.
Perhabs "Boost" in a new shape?

 

 

Interesting. The Boost Move hub in a Technic appropriate shape would be quite disappointing. If two of the ports are integrated motors, then that makes life difficult, especially if the LIEBHERR R 9800 uses two of them.

Where did you read about the tilt sensor?

Also - the Duplo train hub has an inbuilt speaker, so it's not unprecedented for there to be an inbuilt speaker. :) But I agree, it's more likely in this scenario it comes from the app.

EDIT: One of the guys in the Technic subforum had hands on with the hub today. No integrated motors, four ports for motors. As you say, similar size (if a bit smaller) than the EV3 brick. Makes me wonder what all that space is going to...

Edited by Mr Hobbles

Share this post


Link to post
Share on other sites

Hi.

I edited my post meanwhile.
"Tiltsensor" is reported be people visiting the fair.

Duplo only plays stored sounds. (on EV3 I can load anything to it and play) .

Where the space is going to? Perhaps AA batteries for four large motors?

 

Edited by Lok24

Share this post


Link to post
Share on other sites
10 minutes ago, Lok24 said:

Hi.

I edited my post meanwhile.
"Tiltsensor" is reported be people visiting the fair.

 Duplo only plays stored sounds. (on EV3 I can load anything to it and play) .

 Where the space is going to? Perhaps AA batteries for four large motors?

  

Ah yes, I didn't realise that the current Power Functions Technic battery pack uses 6x AA batteries. So that makes sense. :)

Re. Speaker, yep, only stored sounds on the Duplo train, but I wonder how feasible it is to send short audio clips over the BLE connection. For example the WeDo 2.0 hub has an inbuilt piezo buzzer you can send tones to. (Not a full blown speaker though). Yes I know, I'm still wishful thinking. :)

Share this post


Link to post
Share on other sites

even if it has a speaker it could be that only the sounds of the technic models are prgrammed in the microcontroller and you cant change them but i think thats extremly unlikely. hopefully we get a freely programmable internal speeker and it would be really cool if you could like make different sounds at different motor speeds

XGBC

Edited by XGBC

Share this post


Link to post
Share on other sites
Just now, XGBC said:

even if it has a speaker it could be that only the sounds of the technic models are prgrammed in the microcontroller and you cant change them but i think thats extremly unlikely.

Yep, you just described the Duplo train base, but as you say, I think it's unlikely they'll do it for this, as they're reusing the hub for multiple models.

Share this post


Link to post
Share on other sites

Ok, the current documentation from Lego doesn't help here. 
Have anyone of you managed to subscribe to the left (+ / -) and right (+ / -) buttons of a PUP Remote?

EDIT: Found it. It was under 'Sensor Message'. 

Edited by Cosmik42

Share this post


Link to post
Share on other sites

Hi to all,

I tried to use the library Node-PoweredUp (https://github.com/nathankellenicki/node-poweredup)
I have one Smart Hub and one train motor from LEGO City Train.
I haved user Raspberry 3 B+ with last Raspbian version.
After installed Noble Library (https://github.com/noble/noble), and Node-Poweredup, i have activate the BT and execute the example to start/stop motor for 2 second with this command:
node lego.js

The Led on Smart Hub becomes fixed, but the motor (connected to port A) don't start.

The console report:
noble warning: unknown peripheral 90842b00420c
noble warning: unknown peripheral 90842b00420c
noble: unknown peripheral null connected!
noble: unknown peripheral null connected!
noble: unknown peripheral null connected!

What am I doing wrong?

Share this post


Link to post
Share on other sites
8 minutes ago, GianCann said:

Hi to all,

I tried to use the library Node-PoweredUp (https://github.com/nathankellenicki/node-poweredup)
I have one Smart Hub and one train motor from LEGO City Train.
I haved user Raspberry 3 B+ with last Raspbian version.
After installed Noble Library (https://github.com/noble/noble), and Node-Poweredup, i have activate the BT and execute the example to start/stop motor for 2 second with this command:
node lego.js

The Led on Smart Hub becomes fixed, but the motor (connected to port A) don't start.

The console report:
noble warning: unknown peripheral 90842b00420c
noble warning: unknown peripheral 90842b00420c
noble: unknown peripheral null connected!
noble: unknown peripheral null connected!
noble: unknown peripheral null connected!

What am I doing wrong?

Hi, could you post this as an issue on the GitHub repo please? (I’m the creator of that project). Just so we don’t spam this forum with support requests for other software. :)

Share this post


Link to post
Share on other sites
1 minute ago, Mr Hobbles said:

Hi, could you post this as an issue on the GitHub repo please? (I’m the creator of that project). Just so we don’t spam this forum with support requests for other software. :)

Yes, sorry for mistake.

Share this post


Link to post
Share on other sites
On 9/2/2018 at 4:40 AM, Mr Hobbles said:

4. There is a speedometer on the front wheels! The front wheels are completely free wheeling, but the speedometer also reports the speed that they're going at.

Interestingly, if there's no movement on the front wheels, the motored wheels don't go, no matter what commands you give it. So if you tell it to go at speed 100 while holding it in your hands, it will turn on for a second or so, but then turn off again, as the front wheels aren't rotating. It remembers though - if you manually spin the front wheels, it will start moving again.

 
The "Push & Go" patent explains this behaviour. Summarizing it: the base has two axles of wheels, in which the front axle is passive (the wheels follow the movement of the locomotive) and the rear is active (it is motorized). There are two motion detection units. A motion detection unit/sensor is located on the front axle, which detects the movement based on the rotation of the wheels / front axle. The base has a microcontroller unit that detects the signal of the movement sensor of the front axle and based on it activates an electric motor connected to the rear axle that rotates the wheels of this axle continuously. In addition, the locomotive has a second movement sensor connected to the rear axle and capable of detecting a deceleration or a blocking force applied to the movement of the rear axle wheels. If detected, the control unit for the engine and the locomotive stops.The motion detection unit may also detect the rotation speed of the first axis; and based on this, the electric motor starts at a speed that adapts to the speed of rotation detected. It can also detect the direction of rotation of the wheels, applying the driving force to the rear axle in the same direction as the detected rotation. The movement of the front wheels through an action of the Push & Go type activates the operation of the engine, which in turn drives the rear wheels.
 
If you are curious, there are another patents that could be interesting :
  • WO2016177823 (A1) ELECTRICAL CONNECTOR AND CONNECTOR ELEMENTS FOR A MODULAR CONSTRUCTION ELEMENT AND/OR SYSTEM
  • WO2016037977 (A1) A METHOD FOR ESTABLISHING A WIRELESS CONNECTION BETWEEN ELECTRONIC DEVICES
  • WO2017037301 (A1) A TOY CONSTRUCTION SYSTEM COMPRISING A REMOTE CONTROL DEVICE
  • WO2017037302 (A1) A REMOTE CONTROL DEVICE
  • WO2018158357 (A2) AN INTERACTIVE MODULAR CONSTRUCTION ELEMENT AND A MODULAR CONSTRUCTION SYSTEM WITH INTERACTIVE MODULAR CONSTRUCTION ELEMENTS
  • WO2016037978 (A1) A METHOD FOR ESTABLISHING A FUNCTIONAL RELATIONSHIP BETWEEN INPUT AND OUTPUT FUNCTIONS
  • WO2015173246 (A1) A TOY CONSTRUCTION SYSTEM WITH FUNCTION CONSTRUCTION ELEMENTS
  • WO2016124584 (A2) TOY SYSTEM COMPRISING TOY ELEMENTS THAT ARE DETECTABLE BY A COMPUTING DEVICE
  • WO2016062671 (A1) A TOY CONSTRUCTION SYSTEM AND A METHOD FOR A SPATIAL STRUCTURE TO BE DETECTED BY AN ELECTRONIC DEVICE COMPRISING A TOUCH SCREEN
 

LDWO2018078151L.png

Share this post


Link to post
Share on other sites

Thank you to the library written by @Mr Hobbles, i made a 'control train system' based on Raspberry 3B+ / MQTT / Node-Red.

With this system it's possibile to control 4 trains at same time directly from smartphone phone with a free MQTT App Client.
Raspberry act as Access Point for the smartphone device, and a bluetooth gateway for PoweredUp HUB.

This is a first pieces of my 'ItLUG - Train System', a system to automate trains layout in a LEGO City Diorama with a complex logic.
In each train there is a WiFi based  sensor (realized with a ESP8266 03 chip) that track train position long the circuit.
The Node-Red logic flow, interact with other device like railroad switch and level crossing barrier (also controlled by an ESP8266 device).

I hope to make the Raspbian distro 'out of the box' available in a few days.

This is the image of Node-Red Workflow (drive link to image, because it's to large to upload on Eurobricks Forum)

These are the screenshots from Smartphone 'App' (it's based on IOT MQTT Panel App), one for control and one for battery status monitor

ControlloTreni1.png.d33e5b993441721844862afc75c3732b.png 

 

ControlloTreni2.png.4af44670803885c123733295850e97fd.png

Edited by GianCann

Share this post


Link to post
Share on other sites
7 hours ago, GianCann said:

In each train there is a WiFi based  sensor (realized with a ESP8266 03 chip) that track train position long the circuit.

Can you share more info about this?  Sounds neat.

Share this post


Link to post
Share on other sites
On 1/24/2019 at 6:46 PM, Mr Hobbles said:
On 1/23/2019 at 7:26 PM, Cosmik42 said:

So I kinda just discovered the official protocol from Lego!

And I found what I was looking for there: more than a disconnect, a power off:

[0x03 0x00 0x02 0x01]

Adding that 0x01 specify a clean power off. So no chance to reconnect again if you are still listening.

Ah good, glad you found something! I am still trawling through that document and adding support for various features to my library. :)

I do wish it was more detailed into the various commands that can be sent to the various attached devices. While it does a pretty good job of detailing the protocol, it mentions very little about sensor modes and message parsing, special motor control modes (ie. swing mode), etc.

Any idea how to do this but for WeDo 2.0 Hub? I am finally implementing it and can't seem to find the 'Shutdown' call.

Share this post


Link to post
Share on other sites

Oh I found it by downloading the WeDo 2.0 Official SDK.
They have a dedicated Characteristic just for disconnecting:
        private const string WEDO2_DISCONNECT = "0000152B-1212-efde-1523-785feabcd123"; // "152B"

The call looks like this: 

WriteMessage(new byte[0], CharacteristicDisconnect);

 

Share this post


Link to post
Share on other sites
On 2/2/2019 at 4:00 PM, TrainDragon said:

Can you share more info about this?  Sounds neat.

I am working, together with other AFOL, to develop various sensors (magnetic, proximity, laser) that enter the dimensions of a 2x4 brick and are powered to 9v.
The sensors implement MQTT communication via WiFi.
The Raspberry Pi 3B + system, with Node-Red and Mosquitto, functions as a message center and control logic between sensors and motors.

This is the proxymity sensor based on Broacom ADPS9960 colors & proximity sensor.
The ESP8266 chip act as WiFi client connected to an MQTT broker (running on Raspeberry) and send MQTT messages when the sensor is activated.
50758771_10216340260492973_3091953703784022016_n.jpg.c01d88ce388922796950c68e18264779.jpg

Share this post


Link to post
Share on other sites
8 hours ago, GianCann said:

I am working, together with other AFOL, to develop various sensors (magnetic, proximity, laser) that enter the dimensions of a 2x4 brick and are powered to 9v.
The sensors implement MQTT communication via WiFi.
The Raspberry Pi 3B + system, with Node-Red and Mosquitto, functions as a message center and control logic between sensors and motors.

This is the proxymity sensor based on Broacom ADPS9960 colors & proximity sensor.
The ESP8266 chip act as WiFi client connected to an MQTT broker (running on Raspeberry) and send MQTT messages when the sensor is activated.

Sounds amazing! Do you plan to sell these? Any chance to make them compatible with PF or PF2 plugs?
Would love to integrate these to "The Lego Train Project" if you make them available.

Share this post


Link to post
Share on other sites
On 2/2/2019 at 5:13 PM, Cosmik42 said:

Oh I found it by downloading the WeDo 2.0 Official SDK.
They have a dedicated Characteristic just for disconnecting:
        private const string WEDO2_DISCONNECT = "0000152B-1212-efde-1523-785feabcd123"; // "152B"

The call looks like this: 


WriteMessage(new byte[0], CharacteristicDisconnect);

 

Thank you - it's been a while since I looked at the WeDo SDK, good find! I'll pop it into my library too. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.