-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build issues on MacOS caused in upstream dependency (fako1024/gatt) #2
Comments
Hi, but sure it does (it's not a variable, it's a function): https://github.com/fako1024/gatt/blob/v1.0.0/option_linux.go#L27 Without further information I can't really say what the issue is, I'd need to know your setup and what exactly you tried to do that lead to the above error. Cheers! |
Hi,
as i said, i am new to go.
I set up a standard go on Mac OS. And i want to run your example from your git.
And these is the output:
I read this as a problem in the felicita pkg.
I did already ‚go mod tidy‘ in my folders.
Is there an easy to fix error?
Thank you,
Jürgen
… Am 15.03.2022 um 10:17 schrieb fako1024 ***@***.***>:
Hi,
but sure it does (it's not a variable, it's a function): https://github.com/fako1024/gatt/blob/v1.0.0/option_linux.go#L27 <https://github.com/fako1024/gatt/blob/v1.0.0/option_linux.go#L27>
Without further information I can't really say what the issue is, I'd need to know your setup and what exactly you tried to do that lead to the above error.
Cheers!
—
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ANI55FY7ZZYZVHRTNY3OSUTVABIRDANCNFSM5QWPU32Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.
|
That's probably the caveat here, since I never tried it on MacOS. I took over the gatt package a while ago from the initial maintainers after it went dead and got it to work on linux again (took only some minor fiddling), but since I don't use Mac I didn't even get the chance to look into that part of the code. I'll give it a shot and try to at least figure out the compilation issue using Docker (because tbh it shouldn't even hit the _linux files when compiling on Darwin, so this error message is at least confusing), but even if I get that to work I can't at all guarantee that the whole bluetooth stack will be accessible / working, so you'd be on your own regarding that. But I'll be more than happy to take PRs... |
Hi,
OK, i understand.
Do you have a documentation, what the felicita scale will send via bluetooth or can you send me a link, where i can have a look how the data are exposed?
Thank you,
Jürgen
… Am 15.03.2022 um 18:32 schrieb fako1024 ***@***.***>:
That's probably the caveat here, since I never tried it on MacOS. I took over the gatt package a while ago from the initial maintainers after it went dead and got it to work on linux again (took only some minor fiddling), but since I don't use Mac I didn't even get the chance to look into that part of the code. I'll give it a short and try to at least figure out the compilation issue using Docker (because tbh it shouldn't even hit the _linux files when compiling on Darwin, so this error message is at least confusing), but even if I get that to work I can't at all guarantee that the whole bluetooth stack will be accessible / working, so you'd be on your own regarding that. But I'll be more than happy to take PRs...
—
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ANI55F7QW52VVQ5RCSR6T5LVADCUVANCNFSM5QWPU32Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.
|
Hi again,
i read in your code and i found a lot helpful stuff.
What i could not find is: what means byte 12 and 13 in the req data ?
Do you have information for this?
Thank you,
Jürgen
func (f *Felicita) receiveData(c *gatt.Characteristic, req []byte, err error) {
if len(req) != 18 {
return
}
weight, err := strconv.ParseFloat(string(req[2:9]), 64)
if err != nil {
return
}
dataPoint := &scale.DataPoint{
TimeStamp: time.Now(),
Weight: weight / 100.,
Unit: parseUnit(req[9:11]),
}
f.batteryLevel = parseBatteryLevel(req[15])
f.isBuzzingOnTouch = parseSignalFlag(req[14])
f.unit = dataPoint.Unit
… Am 15.03.2022 um 18:32 schrieb fako1024 ***@***.***>:
That's probably the caveat here, since I never tried it on MacOS. I took over the gatt package a while ago from the initial maintainers after it went dead and got it to work on linux again (took only some minor fiddling), but since I don't use Mac I didn't even get the chance to look into that part of the code. I'll give it a short and try to at least figure out the compilation issue using Docker (because tbh it shouldn't even hit the _linux files when compiling on Darwin, so this error message is at least confusing), but even if I get that to work I can't at all guarantee that the whole bluetooth stack will be accessible / working, so you'd be on your own regarding that. But I'll be more than happy to take PRs...
—
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ANI55F7QW52VVQ5RCSR6T5LVADCUVANCNFSM5QWPU32Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.
|
First of all: The build on MacOS should be fixed now on master and with the new tag / release v1.0.1, so you should be able to give the examples a go without running into build issues at least. As for your question: Unfortunately there's no official (or semi-official) documentation on the byte format, so I had to reverse engineer most of it. AFAIK bytes 12 and 13 are unused / reserved (at least I couldn't identify any usage for it). There's a few people that interfaced with the scale in the scope of different projects (e.g. https://github.com/nrontsis/OhMyShot/blob/main/OhMyShot!/Hardware/felicita_interface.swift), but they don't seem to access those fields either, so at least the data doesn't hold anything critical and probably can safely be ignored. Let me know if your build succeeds with the newest release please (and, if you like, if you can successfully access the scale under MacOS). |
Hi, thank you for your interest.
I tried your new code. I started logger.go and scaletool.go. The results are the same:
VisualCode Studio shows me:
= the source _cgo_gotypes.go could not be load and also this:
Do you have an idea, whether i make the problems, maybe in my folders or where else the error comes from ?
Can i start logger.go in VisualCode or do i have to use Terminal ? What would be the correct way ?
Jürgen
… Am 17.03.2022 um 10:26 schrieb fako1024 ***@***.***>:
First of all: The build on MacOS should be fixed now on master and with the new tag / release v1.0.1, so you should be able to give the examples a go without running into build issues at least.
As for your question: Unfortunately there's no official (or semi-official) documentation on the byte format, so I had to reverse engineer most of it. AFAIK bytes 12 and 13 are unused / reserved (at least I couldn't identify any usage for it). There's a few people that interfaced with the scale in the scope of different projects (e.g. https://github.com/nrontsis/OhMyShot/blob/main/OhMyShot!/Hardware/felicita_interface.swift <https://github.com/nrontsis/OhMyShot/blob/main/OhMyShot!/Hardware/felicita_interface.swift>), but they don't seem to access those fields either, so at least the data doesn't hold anything critical and probably can safely be ignored.
Let me know if your build succeeds with the newest release please (and, if you like, if you can successfully access the scale under MacOS).
—
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ANI55F25JQQMXFPAULRMQE3VAL3DPANCNFSM5QWPU32Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.
|
Your post is missing all the output, can you please add it? If the result is the same then you're maybe not on the current master branch (because the issue is fixed as per the build pipeline, I even added Darwin / MacOS specific tests). Can you please also outline the exact steps you have taken? What is the output of |
1. I made a fresh git clone to folder G_W.
drjs-MBP-4:G_W web$ git clone https://github.com/fako1024/btscale.git
2. cd into /Users/web/Desktop/G_W/btscale/cmd/logger
3. drjs-MBP-4:logger web$ go build ./
4. then startet logger with a doubleclick
5. result:
Last login: Mon Mar 14 19:14:39 on ttys000
/Users/web/Desktop/G_W/btscale/cmd/logger/logger ; exit;
drjs-MBP-4:~ web$ /Users/web/Desktop/G_W/btscale/cmd/logger/logger ; exit;
panic: runtime error: cgo argument has Go pointer to Go pointer
goroutine 1 [running]:
github.com/fako1024/gatt/xpc.XpcConnect.func2(0xa600000, 0xf)
***@***.***/xpc/xpc_darwin.go:162 +0x38
github.com/fako1024/gatt/xpc.XpcConnect({0x40e166e, 0xf}, {0x4105cc0, 0xc000148000})
***@***.***/xpc/xpc_darwin.go:162 +0xb7
github.com/fako1024/gatt.NewDevice({0x41d3ee0, 0x0, 0x0})
***@***.***/device_darwin.go:66 +0x17a
github.com/fako1024/btscale/pkg/felicita.New({0x0, 0x0, 0xc000142010})
/Users/web/Desktop/G_W/btscale/pkg/felicita/felicita.go:75 +0xc8
main.main()
/Users/web/Desktop/G_W/btscale/cmd/logger/logger.go:34 +0x225
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...16 completed.
[Prozess beendet]
to me it looks as the same error as started in VisualStudioCode:
cgo argument has GO Pointer. —> panic
… Am 17.03.2022 um 13:45 schrieb fako1024 ***@***.***>:
Your post is missing all the output, can you please add it? If the result is the same then you're maybe not on the current master branch (because the issue is fixed as per the build pipeline, I even added Darwin / MacOS specific tests). Can you please also outline the exact steps you have taken? What is the output of go build ./... from the main repository path right after a fresh git lone of the repository?
—
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ANI55FYQSJNXSNOCMPWGDJLVAMSN5ANCNFSM5QWPU32Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.
|
Thanks, those details helped a lot. I'll investigate asap, unfortunately GitHub is currently degraded (https://www.githubstatus.com/) and I can't even run any workflows to test... 😭 - I'll keep you posted. |
If you tell me what to do, i will do my best, that you will get this problem sorted.
Let me know, if i steel your time because i am a GO novice.
Jürgen
… Am 17.03.2022 um 16:09 schrieb fako1024 ***@***.***>:
Thanks, those details helped a lot. I'll investigate asap, unfortunately GitHub is currently degraded (https://www.githubstatus.com/ <https://www.githubstatus.com/>) and I can't even run any workflows to test... 😭 - I'll keep you posted.
—
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ANI55F6CRCHY5VMBDSG2NADVANDLLANCNFSM5QWPU32Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.
|
No worries, and thanks for the support. I'll try to get my hands on a MacBook in the next days to actually try to connect to my Felicita scale and properly test it. In the meantime maybe you could give it another try on the current |
Hi,
i did the same procedure as described in my last mail. This is the result:
Last login: Sat Mar 19 18:22:52 on ttys002
drjs-MBP-4:~ web$ /Users/web/Desktop/G_W_2/btscale/cmd/logger/logger ; exit;
panic: interface conversion: interface {} is nil, not xpc.UUID
goroutine 17 [running, locked to thread]:
github.com/fako1024/gatt/xpc.Dict.MustGetUUID(...)
***@***.***/xpc/xpc_darwin.go:60
github.com/fako1024/gatt.(*device).HandleXpcEvent(0xc000148000, 0x0, {0x0, 0x0})
***@***.***/device_darwin.go:429 +0xbf4
github.com/fako1024/gatt/xpc.handleXpcEvent(0x4402a40, 0x1)
***@***.***/xpc/xpc_darwin.go:192 +0x16c
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Prozess beendet]
It seems, that you are making some progress.
Jürgen
… Am 19.03.2022 um 10:13 schrieb fako1024 ***@***.***>:
No worries, and thanks for the support. I'll try to get my hands on a MacBook in the next days to actually try to connect to my Felicita scale and properly test it. In the meantime maybe you could give it another try on the current master branch, I've added a few more upstream changes that should hopefully fix the crashes. Might still not connect to the actual scale, but at least build properly now. Thanks a lot!
—
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ANI55FZ4PS76QG2ONTXPGFDVAWLEPANCNFSM5QWPU32Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.
|
Hi,
i wanted to play with my scale from felicita with your code. But i get this error:
pkg/felicita/felicita.go:38:3: undefined: gatt.LnxMaxConnections
pkg/felicita/felicita.go:39:3: undefined: gatt.LnxDeviceID (exit status 2)
I looked into your gatt module and could not find the variables LnxMaxConnections.
I am new to go language.
How can i fix my errors?
Thank You.
The text was updated successfully, but these errors were encountered: