P8 smartwatch as a Dash for electric unicycles.

Posted on
  • Hello, thanks to the work of @fanoush and @atc1441, I was able to install espruino on a P8 smartwatch (pinetime compatible) and use it as a dashboard for my electric unicycle.

    I just wanted to thank @gordon for the work on espruino, and share my playground if one cares to have a look. :)

    https://github.com/enaon/eucWatch

  • Nice - thanks for posting that up!

  • thank you for the welcome Gordon.

    i am leaving this little video here, in case someone doesn't know what an euc is.

    I really believe that someone with more advanced skills than mine could have his time payed back if he develops a good watch for the euc world, there is not a standalone solution up to now, and there sure is interest.

    https://streamable.com/9wh0a1

  • Wow - that looks absolutely insane! How does he control the EUC? It's just the angle his feet are at?

    So is your watch for an off the shelf EUC, or is it a custom EUC controller that can work via Bluetooth LE?

    What you've got there looks great, but if you wanted something a bit easier for people to use then you could target Bangle.js itself and put an app in the Bangle.js app loader that could just be installed. At least then someone could just buy a watch and get started without having to do the extra flashing steps.

  • They are controlled by changing the center of gravity, think Magneto of the xmen :)

    The scripts are for off the shelf (xiaomi/segway) ninebot one c/e/p models,

    Here is a more down to earth video I shot myself, very interesting machines I believe.
    https://www.youtube.com/watch?v=4nQZtHoy­Q7s

    Yes the bangle.js seems easier, I really did't know about it when I started playing with the dsd6/p8, I accidentally found a channel where atc1441 and fanoush were hacking things, and got engaged. I didn't even know any javascript at that time. :)

    Thanks again for espruino, I really enjoy it. :)

  • I leave this video too, as it was the one that got me wanting to get one, three months later I was becoming a superhero. :D

    https://www.youtube.com/watch?v=MwoF1K-o­mHM

  • two small videos, one on alarms and one for the calculator.

    I have a nice feature in alarms, where if one does a long hold on the settings page, the current time is auto set to that alarm, so one could move using the finger hours-tenths of ninutes- minutes, and time drags (10:55 becomes 11:05 with a move up in tenths of minutes), thus it can be also used as a timer. :)

    the calculator has history that can be used in calculations simply by taping on it, the code is bad but it works nice :)

    https://streamable.com/hm0ynu

    https://streamable.com/bq5xbe

  • I remade the quick panel, it now has app loader and sub settings :)

  • Wow, nice!

  • How do you break fast enough without falling off if an elderly person)disabled person/falls in the road or goes slowly across the road or if a child unexpectedly dashes out/to the side, etc ?

  • you need to be aware, but braking is as natural as accelerating, you just lean backwards and it stops. If you want to do an mergency brake, you bring the wheel in front of you at the same time and step hard on it, it stops quite fast.

  • Hello from Cyprus!
    Thanks a lot for sharing - Σε Ευχαριστώ ! I have install it and it is working perfectly!!!!

  • @gordon, I have a question if possible.

    I am trying to make the p8 connect to the wheel, and then replicate the wheel's services and offer them, so that a phone can connect to the watch and then the wheel, like a bridge

    It is working, amazing what one can do with espruino, but I have come to a problem.

    When it comes to the phone app that I want to use, it does some checks on a list of characteristics and services it expects to find, and closes the connection if one is not there. They are not needed, but it does it anyway.

    The code that does the checks is like so:

    detected_wheel = true;
    BluetoothGattCharacteristic characteristic = service.getCharacteristic(c_uuid);
     if (characteristic == null) {
      detected_wheel = false;
      break;
    }
    

    and the services among others are those, that I cannot create.:

    <string-array name="kingsong_services">
        <item>00001800_0000_1000_8000_00805f9b34­fb</item>
        <item>00001801_0000_1000_8000_00805f9b34­fb</item>
        <item>0000180a_0000_1000_8000_00805f9b34­fb</item>
        <item>0000fff0_0000_1000_8000_00805f9b34­fb</item>
        <item>0000ffe0_0000_1000_8000_00805f9b34­fb</item>
    </string-array>
    
    <string-array name="kingsong_00001800_0000_1000_8000_0­0805f9b34fb">
        <item>00002a00_0000_1000_8000_00805f9b34­fb</item>
        <item>00002a01_0000_1000_8000_00805f9b34­fb</item>
        <item>00002a02_0000_1000_8000_00805f9b34­fb</item>
        <item>00002a03_0000_1000_8000_00805f9b34­fb</item>
        <item>00002a04_0000_1000_8000_00805f9b34­fb</item>
    </string-array>
    <string-array name="kingsong_00001801_0000_1000_8000_0­0805f9b34fb">
        <item>00002a05_0000_1000_8000_00805f9b34­fb</item>
    </string-array>
    

    lines starting with a 'greater than' denote quoted text

    because they are on 0x1800 and 0x1801.

    The app is wheellog from github, I removed the check and compiled it and it connects fine, but It would be nice if it worked with all programs.

    Is it a dead end, of could I add the missing characteristics?

  • 'The app is wheellog from github'

    Would you mind sharing the link please so that we may follow along to assist.

  • ofcource, it is here( a lot of variants exist, but this is the first one I think)
    https://github.com/JumpMaster/WheelLog

    The part that does the checks is here:
    https://github.com/JumpMaster/WheelLogAn­droid/blob/44b9b2fbdb522d499bcf932baa0de­cde389f92cf/app/src/main/java/com/cooper­/wheellog/WheelData.java#L1070

    and the expected characteristics are here:
    https://github.com/JumpMaster/WheelLogAn­droid/blob/master/app/src/main/res/value­s/services_kingsong.xml

    But the question is not really about the app, it is about the possibility of adding characteristics on 1800 and 1801

    In any case I have asked the maintainer of eucWorld, the dominant app for EUCs in android, a derivative of wheellog, to remove 2a02, 2a03,2a05 from his list of checks, and he was kind enough to consider it, so I am all good. But it would still be nice if there is a way to add them.

  • Those are kind of special, you can find them in 16bit uuid pdf here https://www.bluetooth.com/specifications­/assigned-numbers/

    GATT Service
    0x1800 Generic Access
    0x1801 Generic Attribute

    GATT Characteristic and Object Type
    0x2A00 Device Name
    0x2A01 Appearance
    0x2A02 Peripheral Privacy Flag
    0x2A03 Reconnection Address
    0x2A04 Peripheral Preferred Connection Parameters
    0x2A05 Service Changed

    They need to be implemented in specific way for BLE/GATT to work properly so you control them by calling specific softdevice APIs or passing specific data/flags. You can't implement them yourself in javascript. At least the 0x2A04 Peripheral Preferred Connection Parameters and 0x2A05 Service Changed are pretty important to work as expected or stuff will break.

    So yes you can make espruino to look the same but by modification of C source in https://github.com/espruino/Espruino/blo­b/master/targets/nrf5x/bluetooth.c

  • Thank you @fanoush, it's good to know that it can be done. :)

    Espruino is only missing 0x2A02 0x2A03 and 0x2A05, their value is not used, just their existence.

  • I'm not sure what your feelings are on this @fanoush, but maybe there's a way to detect the characteristics being mentioned in setServices and then add the relevant softdevice calls?

    However it's a bit hacky - since WheelLog is open source, did you trying to submit a PR to remove the un-needed checks? I'm not sure how Android handles Characteristic scanning but it's possible that removing them would improve connection speed for all app users

  • I did it my self on wheelllog since it is open source. But the eucWorld app, which is based on wheelllog is not open source, and it it the only that I care about having because of its logging and online maps features. Also I think darkness bot, the dominant iphone app, has the same checks.

    But in any case, it is more of a "wanting to do" thing, I wanted to make the bridge work, and it drove me mad that I couldn't. Now that I know why it did't work I am feeling much better.

    I will continue working on it and when it is finished with the menus and all, I may ask for some more help.

  • a small video with a test :)

    https://www.youtube.com/watch?v=veTZA-ub­mdA

  • Wow, nice - so you can chain them all together??

  • yes, your software is super, it is updating a bit slow but that is me. :)

    I will continue with the bridge, it will be useful for adding say a dsd6 inside the helmet only for receiving alarms from its buzzer. Later it will be really nice if I could add those characteristics so that the the phone app can connect without changes.

    this is a small video of the wheels settings menu, garage and all. :D

    https://www.youtube.com/watch?v=XLtAZK4b­FRE

  • Watched full video, the UI is very nice, full touch with such UI design feels natural. This really looks professional, you would not have guessed there is javascript interpreter behind it :-) Native firmware in some watches feels slower and less polished than this.

    say a dsd6 inside the helmet only for receiving alarms from its buzzer

    BTW I still have plenty of them, if anyone wants some DS-D6 I can ship them relatively cheap (e.g. two for 15 eur including registered EU shipping, shipping is almost a fixed cost at this weight so more can get cheaper). Got carried away when they were cheap and won't really have a chance to use them all :-) Still new in box. Also have few others (DK08,F07,HX03W). If anyone is interested just PM me. Otherwise sorry for spam.

  • missing 0x2A02 0x2A03 and 0x2A05, their value is not used

    the first two are mentioned here https://devzone.nordicsemi.com/f/nordic-­q-a/26129/add-peripheral-privacy-flag-an­d-reconnection-address-characteristics-t­o-generic-access-service-in-nrf52832 this is something that was removed from bluetooth specs, I still don't know what it actually does - something about secure connections when address is changing?

    0x2A05 is service changed, that should allow updating list of services, characteristics without need to disconnect and reconnect when implemented properly, was already discussed here http://forum.espruino.com/conversations/­357737/

  • Thank you for the nice feedback, I really appreciate it.

    You are one of those persons that never spam, I will ask you for some dsd6's later if you still have some.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

P8 smartwatch as a Dash for electric unicycles.

Posted by Avatar for enaon @enaon

Actions