Jump to content

super_teabag

Member
  • Posts

    186
  • Joined

  • Last visited

Reputation Activity

  1. Like
    super_teabag got a reaction from ivycomb in Thanks LTT   
    Just signed an offer letter for a senior software engineer position with Herman Miller :D. Wanted to say thanks to the LTT community and Linus cuz I've been a subscriber of the channel since... the times he reviewed random toys at NCIX.
     
    Just wanted to make this post to show that you guys make a difference 😛.
  2. Like
    super_teabag got a reaction from WhitetailAni in Thanks LTT   
    Just signed an offer letter for a senior software engineer position with Herman Miller :D. Wanted to say thanks to the LTT community and Linus cuz I've been a subscriber of the channel since... the times he reviewed random toys at NCIX.
     
    Just wanted to make this post to show that you guys make a difference 😛.
  3. Like
    super_teabag got a reaction from da na in Thanks LTT   
    Just signed an offer letter for a senior software engineer position with Herman Miller :D. Wanted to say thanks to the LTT community and Linus cuz I've been a subscriber of the channel since... the times he reviewed random toys at NCIX.
     
    Just wanted to make this post to show that you guys make a difference 😛.
  4. Like
    super_teabag got a reaction from Frugivore8894 in Thanks LTT   
    Just signed an offer letter for a senior software engineer position with Herman Miller :D. Wanted to say thanks to the LTT community and Linus cuz I've been a subscriber of the channel since... the times he reviewed random toys at NCIX.
     
    Just wanted to make this post to show that you guys make a difference 😛.
  5. Like
    super_teabag got a reaction from TetraSky in Thanks LTT   
    Just signed an offer letter for a senior software engineer position with Herman Miller :D. Wanted to say thanks to the LTT community and Linus cuz I've been a subscriber of the channel since... the times he reviewed random toys at NCIX.
     
    Just wanted to make this post to show that you guys make a difference 😛.
  6. Like
    super_teabag got a reaction from igormp in Reverse Engineering Bluetooth Data for fun   
    Hey all!
     
    This isn't a "hey please help I've fallen and can't get up" kind of post, but rather one that's imho dense with computer science topics. 
    My hope is that it will genuinely peek someone's interest in computer science, programming, reverse engineering and genuinely inspire people.
     
    Any who, recently got this exercise bike with Bluetooth functionality, right. now I didn't want to pay oodles of money a month for some fitness app.
    So, I was like "I can write my own and it'll work on all my devices"... at least that's the goal.
     
    Starting out I had to connect to the bike's Bluetooth with the caveat being I wanted to do this using a web browser then leverage PWAs (progressive web apps) to install on any of my devices with this very basic exercise app.
    Learned there's an experimental standard for Bluetooth available on 
    navigator.bluetooth  
    Connecting to the bike was relatively easy. I used a Bluetooth discovery app on my phone to figure out what "services" were available on the bike's Bluetooth server.
    It got a little tricky as the data I would get back from the Bluetooth device was 88 bits, or 11 bytes. With no indication of endianess, and no headers were on the data to see where things may be in this arbitrary bundle of bites.
     
    I thereby devised a plan to log the data and see where it changed and using the Bluetooth and with the assistance of Bluetooth discovery apps I learned roughly what the shape of the data would be 

     
    In the highlighted area, I knew that wheel rev, last crank even time, last wheel event time, and crank revolutions would be 16 bit unsigned numbers. Why? Because as I pedaled the bike what my app would read was "rolling over"
    a concept that instead of continuing to count past 16 bits of information. The bike instead resets to 0
     
    Now, where in that 88 bit payload were these 16 bit unsigned numbers? Well, I did some logging of the information which you can see from the included text file of my log.
    Using that I deduced where about 4 of these numbers were in the payload as they also lined up with my Bluetooth sniffing application told me.
     
    The following is what gives me the correct data readout from my bike on the web! Now, I have to do some math to calculate RPM and KPH or MPH.
     
    private readonly parseCadenceWheelSpeedWheelTime = (event: { target: { value: DataView } }) => { const { value: dataView } = event?.target; const littleEndian = true; // wheel revolutions in unsigned 16 bit numbers. this.wheelRevolutions$.next(dataView.getUint32(1, littleEndian)); // last wheel event time in unsigned 16 bit numbers. this.lastWheelEventTime$.next(dataView.getUint16(5, littleEndian)); // amount of times the wheel went around in unsigned 16 bit numbers. this.crankRevolutions$.next(dataView.getUint16(7, littleEndian)); // last crank event time in unsigned 16 bit numbers. this.lastCrankEventTime$.next(dataView.getUint16(9, littleEndian)); };  
     
    bluetooth-logging.txt
  7. Informative
    super_teabag got a reaction from shadow_ray in [Typescript] translate bluetooth DataView notifications to usable data.   
    Hello! This may be a bit long winded, but bare with me. 
      TLDR: Looking for ways of parsing binary response from a Bluetooth device.   So, I've got a crazy idea (maybe) in that I've been trying to develop a data logging application and fitness tracker for my new IC4 bike. The difference between this app and others available on the market is that it works via the experimental Bluetooth browser standard. Described in more detail here. Web Bluetooth API - Web APIs | MDN (mozilla.org).   Getting to the point. I've paired to my Bluetooth connection (server). Parsed through the services available and exposed by using a Bluetooth discovery application on my phone. Again, pairing to the bike. I'm able to see what I can retrieve, notify, read, write etc. But I don't know how to translate that on a web browser?   Why might that be? Well, since the standard is relatively new. When I subscribe to notifications from the bike via Bluetooth. On the characteristic CSC Measurement I get a little endian binary 88 bit response that I can't seem to figure out where the data indicated above lies. It's not auto-magical like the above screenshot on my phone would indicate.   For example it will look something like this when subscribing to notifications on the WEB for CSC Measurement.   hex: 0x593400e04890 binary: 11001011011010000000000111000000100000011100000   What I do know so far is that the times in milliseconds reported are unsigned 16 bit integers. That lets me guess and check where in the sequence those measurements may be in the response. However rather than guessing and checking I figured I'd just ask if there's an easier way to translate the data received. So, I can use it in my web application. Figured it my android device can parse the Bluetooth notifications then so can I. Also, I've already emailed the manufacturer if there's a data sheet describing the notifications.   import { Injectable } from '@angular/core'; import { SchwinIc4BluetoothCharacteristics, SchwinIc4BluetoothServices } from '@solid-octo-couscous/model'; import { BaseBluetoothConnectionService } from './base-bluetooth-connection.service'; declare const navigator: Navigator; @Injectable() export class SchwinIc4BluetoothConnectionService extends BaseBluetoothConnectionService { constructor() { super( [{ name: 'IC Bike' }], [ SchwinIc4BluetoothServices.cyclingSpeedAndCadence, SchwinIc4BluetoothServices.deviceInformation, SchwinIc4BluetoothServices.fitnessMachine, SchwinIc4BluetoothServices.genericAccess, SchwinIc4BluetoothServices.heartRate, ] ); } public async connectToCyclingSpeedAndCadenceService(): Promise<void> { const primaryBluetoothServices = await this.connectToSchwinBike(); const cyclingSpeedCadenceService = primaryBluetoothServices?.find( service => service.uuid === SchwinIc4BluetoothServices.cyclingSpeedAndCadenceUUID ); const cscMeasurementChararacteristic: | BluetoothRemoteGATTCharacteristic | undefined = await cyclingSpeedCadenceService?.getCharacteristic( // CSC Measurement feature. csc = cycling speed cadence. SchwinIc4BluetoothCharacteristics.cscMeasurement ); const result: | BluetoothRemoteGATTCharacteristic | undefined = await cscMeasurementChararacteristic?.startNotifications(); result?.addEventListener('characteristicvaluechanged', this.parseCadenceWheelSpeedWheelTime); } private readonly connectToSchwinBike = async (): Promise<BluetoothRemoteGATTService[]> => { // TODO: add a check in here to notify the user if they're using a non-supported browser. const userSelectedSchwinIc4Bike: BluetoothDevice = await navigator.bluetooth.requestDevice( this.bluetoothDeviceSearchOptions ); this.bluetoothDevice$.next(userSelectedSchwinIc4Bike); const serverConnection: | BluetoothRemoteGATTServer | undefined = await userSelectedSchwinIc4Bike?.gatt?.connect(); this.bluetoothServer$.next(serverConnection); return (await serverConnection?.getPrimaryServices()) ?? []; }; /** * !!!! this portion is where I'm having trouble after i'm connected and receiving responses. !!!!! **/ private readonly parseCadenceWheelSpeedWheelTime = event => { // here is where the value of the notification would be something like // 0x593400e04890 // this buffer is embedded in a DataView object. const { value } = event?.target; const dataView = value as DataView; console.log(`some real data: ${dataView.getUint16(0, true)}`); console.log(`some other real data: ${dataView.getUint16(2, true)}`); }; }  

  8. Informative
    super_teabag got a reaction from AnotherMax in [Typescript] translate bluetooth DataView notifications to usable data.   
    @AnotherMaxthese are a good starting point, but I found some more resources that were more useful that are super buried on the Bluetooth documentation's website. I'll post here just in case you're curious. Bluetooth Web Tutorial from the horses mouth (it's still dated)
     
    Second, the "characteristics" in Bluetooth terminology are properties in a grouping. that grouping is called a "service" (this isn't me trying to be an asshole about terms). So, the "value" is typed as DataView since the standard has been updated and bugs have been fixed in Chrome / Edge. Again, making the "value" property as a DataView. You'll have to checkout mozilla's documentation on that if you'd like.
     
    Effectively I think I'm SOL cuz it's up to the manufacturer of the device to adhere to the standard for say "heart rate" services. then provide a way to parse the data.
    I've shot nautilus (parent company) a message about what I'm dealing with. Hopefully, they'll give me a data sheet with some more information.
     
    I can parse some of the values from the HEX information provided, but that's just it. I don't know if that's 100% where the data is.
     
     
  9. Agree
    super_teabag got a reaction from AnotherMax in [Typescript] translate bluetooth DataView notifications to usable data.   
    @AnotherMax It's cool duder. yeah, so... that's my last straw that I'm gonna try. There's a few portions of the data MSB (most significant bit) that keeps changing when changing what device it's paired too. Otherwise, I'm 90% certain that bytes 0-2 and 2-4 are for timing cuz they're unsigned 16 bit integers and they line up.
    If I don't have to brute force it and can ask. That's what I'm doing rn cuz work smarter not harder
  10. Funny
    super_teabag got a reaction from Joveice in Nginx, I can see post parameters in logs, even when site is running SSL. What is this?   
    basically this then? (this is a joke)

  11. Like
    super_teabag got a reaction from kirashi in Windows Essentials   
    Hey, this is more of a PSA, but I recently discovered this microsoft supported and open source "Power Tools" they put out there.
     
    Check it out here: Github Power Toys
     
    Of the features that it adds to windows my favorite feature is.
     
    Fancy Zones (for snapping windows to predefined ares) a more advanced windows snap utility.

  12. Like
    super_teabag got a reaction from platysaur in Help me find the right monitor for me   
    From the reviews I've read if you find a dead pixel they definitely replace the panel / swap it out for a not broken unit.
  13. Like
    super_teabag got a reaction from BOOM BOX in LTT 3DMark Thread   
    Hey just coming back to this forum after a 6 year hiatus ha. 
     
    Benchmark: Fire Strike
    CPU: Ryzen 5 3600 stock
    GPU: EVGA GTX 1660 Ti XC Ultra
    GPU Core: 2,135
    GPU Memory: 1,900
    Score: 15, 794
    3DMark Link: http://www.3dmark.com/fs/22444927
  14. Like
    super_teabag got a reaction from LapX in What did you name your computer?   
    named mine Unholy Alliance because of the plethora of case badges and companies i've bought stuff from that are in it, and peripherals i've got. Nothing is really from the same company
  15. Like
    super_teabag got a reaction from Diamond Nacho in What did you name your computer?   
    named mine Unholy Alliance because of the plethora of case badges and companies i've bought stuff from that are in it, and peripherals i've got. Nothing is really from the same company
  16. Like
    super_teabag got a reaction from moonedunk in Is this list accurate?   
    I prefer blues for typing over browns for sure. wish they were sooooo loud though
  17. Like
    super_teabag got a reaction from moonedunk in Is this list accurate?   
    I can't speak for other keyboards, but I can tell the difference between cherry mx blues, and browns on the same type of keyboard.
     
    My brother has a Coolermaster rapid (browns) and I've got a coolermaster rapid (blues). What i find going between the two is that blues are slightly harder to press, and I like they more for the tacticle feed back.
     
    When I switch back to browns they feel mushy (best way i can describe it) and they don't have that audible sound and satisfying click. Much much more satisfying to type on. I can't speak for other keyboards however as I've not yet tried them.
     
    I would personally go for the Das keyboard if you're doing alot of typing as they seem to be centered around typists.
  18. Like
    super_teabag got a reaction from Corvus in Worst Tech mistake you have ever made?   
    Upgrading to 4 gigs of ram with a 32 bit os lol :blink:
  19. Like
    super_teabag got a reaction from terrytek in Worst Tech mistake you have ever made?   
    Upgrading to 4 gigs of ram with a 32 bit os lol :blink:
  20. Like
    super_teabag got a reaction from Tickletehpickle in Worst Tech mistake you have ever made?   
    Upgrading to 4 gigs of ram with a 32 bit os lol :blink:
  21. Like
    super_teabag got a reaction from novasae in Worst Tech mistake you have ever made?   
    Upgrading to 4 gigs of ram with a 32 bit os lol :blink:
  22. Like
    super_teabag got a reaction from JoaoPRSousa in Worst Tech mistake you have ever made?   
    Upgrading to 4 gigs of ram with a 32 bit os lol :blink:
  23. Like
    super_teabag got a reaction from KingCraigx in Worst Tech mistake you have ever made?   
    Upgrading to 4 gigs of ram with a 32 bit os lol :blink:
  24. Like
    super_teabag got a reaction from CowsGoRoar in Worst Tech mistake you have ever made?   
    Upgrading to 4 gigs of ram with a 32 bit os lol :blink:
  25. Like
    super_teabag got a reaction from TheDyer in Worst Tech mistake you have ever made?   
    Upgrading to 4 gigs of ram with a 32 bit os lol :blink:
×