Skip to content

Instantly share code, notes, and snippets.

@vtjnash
Last active January 18, 2023 05:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vtjnash/bb288ffba2a5386f622c1f22d9bae2a3 to your computer and use it in GitHub Desktop.
Save vtjnash/bb288ffba2a5386f622c1f22d9bae2a3 to your computer and use it in GitHub Desktop.
Updating time on MHO-C303 manually (example)
Getting current time:
julia> string(bswap(round(UInt32, datetime2unix(Dates.now()))), base=16) * "00"
"5f3f1f60"
The "00" is the timezone offset (in hours). Here we just use localtime (with offset zero).
With Bluetility.app (from Github) or any other similar tool for bt gatt, look for:
Service: EBE0CCB0-7A0A-4B0C-8A1A-6FF2997DA3A6
Characteristic: EBE0CCB7-7A0A-4B0C-8A1A-6FF2997DA3A6
Read: Hex: 973F1F60_00
Write: Hex: 5f3f1f6000<enter>
Confirming update:
julia> unix2datetime(bswap(0x973F1F60))
2021-02-07T01:17:11
@vtjnash
Copy link
Author

vtjnash commented Feb 7, 2021

@vtjnash
Copy link
Author

vtjnash commented Nov 8, 2022

julia> using Dates; string(bswap(round(UInt32, 30+datetime2unix(Dates.now()))), base=16) * "00" |> clipboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment