Core2 Uiflow TOF default Hub??



  • Hi
    I tried a lot and played with different hardware/units etc. But I think I messed up something. I am a beginner with M5Stack.
    Or is that normal, that when I add a TOF as a unit in uiflow, that in the dropdown for the port, there is already a PaHub to choose? Without added one before?
    While I was playing before that issue?!, I added a PaHub and there 2 times a TOF. But everything worked fine. Then I did something with port adresses etc., but I cant remember what exactly.
    Then I setup my project. And there I recognized, that the TOF Sensors give me wrong values. It looks like scaled wrong. At 10cm in real is was correct. But the min. value was 6cm and at 20cm it was 14cm!?
    I think that the problem is on port a of the core2. So i resetted the core, flash erase with the burner, many different things.
    My questions:
    -How to do a Factory Reset of the core2 and its ports
    -Or is there an other known problem with the TOFS and its standart, that you can choose a PaHub by default while adding a TOF?
    Thanks for your answers....



  • @schorsch, A flash from the Burner software should reset all, ports included. Confirm the basics in burner, the right/latest Core2 package, and in UIFlow the right Core2, etc. I have tried, and tried, to use PaHUB with Ultrasonic sensors and it just wouldn't work.

    The best way I can describe the setup in UIFlow is to add the PaHUB unit and then add the TOF unit. Confirm the PaHUB port is using Port A (of the Core2) and then select for the TOF unit the PaHUB and the port on the PaHUB (0-5) the TOF unit is connected to. This creates the chain.

    To check without PaHUB remove the unit and then change the TOF setting back to Port A (default). The PaHUB appears in the drop down of TOF with or without declaring PaHUB as a unit.

    Thus, switching to the Python window should look something like this:
    pahub_0 = unit. Get(unit.PAHUB, unit. PORTA) # PaHUB to Port A
    tof_0 = unit. Get(unit.TOF, unit.PAHUB0) # TOF to PaHUB Port 0



  • @gavin67890
    That means, in the "uiflow add unit dropdown menu" everything is ok with the default hub?
    It just looked weired to have Pahub to choose, but no unit is already added...
    The rest of the workflow is clear.
    But why to the TOFs send some stupid values? Can I reset a PaHub? On the Tofs I cant reset anything.
    Also stupid values when I connect 1 Tof directly to the A Port



  • I think so. However, I sometimes wonder about the need to +/Add the PaHUB, or if it would work anyway. But yes, the PaHUB option is always present in the TOF dropdown (and for other sensors).

    For the values have you seen the example in UIFlow? It is for original Core and ToF, but with a little adaption it might provide you with a quick test.

    0_1697279250217_Screenshot 2023-10-14 at 11.23.59.png



  • That always worked. But 500 mm(The result comes in mm I think) from the TOF are in real something totally different. It does not matter what surface. I tried a lot. I need a correct value from the TOF for my project...
    Any Idea?



  • Only to have a look through the chip datasheet, see if there's anything else to try.
    https://www.st.com/resource/en/datasheet/vl53l0x.pdf



  • @gavin67890
    Really funny. They need to be calibrated!!! No out of the box...



  • No. I was wrong. No calibration. Only if you measure through glass or stuff like that…
    So I still have the same Problem.
    My Core2 with a DinBase powered with a 12 Volt power thing.
    PaHub in PortA and the Tof plugged on Ch0
    A simple code to loop the distance of the unit to a label. In real its 13 cm. Running the Code via ChromeBrowser with Wlan to the Core.
    Distance is 13.x. Perfect. Then write some code and click Run again. Distance is 7-8cm?!?

    Then I tried:
    Remove and add again the hub and tof
    Direct connection from tof to the Core on PortA
    Reset the Core
    Switch off the core with the small switch on the DinBase
    Unplug and replug the power cable
    Close the Ch0 on the Hub and open again
    And other stuff…

    Sometimes the distance was correct, but mostly wrong. I could not see any rule of the issue. When happens what?

    Any ideas?



  • What's your appetite for Arduino like? M5Stack have done an example for the Core2 and ToF sensor. It might give you the control to understand what is happening and correct.



  • I decided me for M5 Stack, because I like the different sensors and Cores also look good. An a shop nearby sells that stuff.
    Everything else is fine! I ordered another Distsensor to see what happens
    I just finished my project. But everything depends on a correct distance.

    I will see. Thanks so far