Git Product home page Git Product logo

mac2mqtt's People

Contributors

bessarabov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mac2mqtt's Issues

Crashes when trying to get battery state of mac mini

panic: runtime error: index out of range [1] with length 0

goroutine 32 [running]:
main.getBatteryChargePercent(0xc000049ef0, 0x1319948)
        /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:284 +0x115
main.updateBattery(0x137cc20, 0xc000198000)
        /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:290 +0x85
main.main.func1(0xc00013a370, 0x137cc20, 0xc000198000, 0xc00013a3c0)
        /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:318 +0xe5
created by main.main
        /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:310 +0x1d0

macOS Ventura: strconv.Atoi: parsing "missing value": invalid syntax

I've just updated to macOS Ventura today, I'm now getting the following error when trying to execute the mac2mqtt file:

conor@Conors-MacBook-Pro mac2mqtt % ./mac2mqtt
2022/10/25 13:26:29 Started
2022/10/25 13:26:29 Connected to MQTT
2022/10/25 13:26:29 Sending 'true' to topic: mac2mqtt/Conors-MacBook-Pro/status/alive
2022/10/25 13:26:31 strconv.Atoi: parsing "missing value": invalid syntax

Doesn't run on boot, manual opening needed

mac2mqtt 1.3.1 running on 11.5.2 doesn't launch on boot even with KeepAlive and RunAtLoad enabled in /Library/LaunchDaemons/com.bessarabov.mac2mqtt.plist. It doesn't run unless i manually run launchctl load /Library/LaunchDaemons/com.bessarabov.mac2mqtt.plist

Console shows Aug 31 10:32:24 Mac com.apple.xpc.launchd[1] (com.bessarabov.mac2mqtt[8205]): Service exited with abnormal code: 2 every minute.

What else can I check? Thanks.

Program terminating itself after a while, trying to access Dropbox directory

Hello,

I am interested in this software just to shutdown remotely via Home Assistant, but I am running into several problems.

Let's start in the first one.

I edited the files in order to reflect my username, but when mac2mqtt is running, it terminates itself after a while using "bessarabov" absolute username.
I thinks this is in the program itself and not in my YAML files.
What is it trying to do accessing a Dropbox directory?
Have I forget to change somewhere?

Can you please help me?

<-user->@<-computer-> mac2mqtt % ./mac2mqtt
2022/11/22 09:45:51 Started
2022/11/22 09:45:51 Connected to MQTT
2022/11/22 09:45:51 Sending 'true' to topic: mac2mqtt/<-computer->/status/alive
panic: runtime error: index out of range [1] with length 0

goroutine 45 [running]:
main.getBatteryChargePercent(0xc00004fef0, 0x1319948)
/Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:284 +0x115
main.updateBattery(0x137cc20, 0xc000120000)
/Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:290 +0x85
main.main.func1(0xc0001a6000, 0x137cc20, 0xc000120000, 0xc0001a6050)
/Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:318 +0xe5
created by main.main
/Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:310 +0x1d0
<-user->@<-computer-> mac2mqtt %

import cycle not allowed

Hi, I am not a Go person.
Getting the following error while running $ go run mac2mqtt.go

mac2mqtt % go run mac2mqtt.go package command-line-arguments imports gopkg.in/yaml.v2 imports gopkg.in/yaml.v2: import cycle not allowed

unreliable

Hello,
I don't know if anyone is having this issue.
Here is a list of how mqtt alive property changes when my macmini is on:

21/6/2023, 9:18:17 node: ISOFF debug 117 mac2mqtt/Mac-mini-de-Fernando/status/alive: msg.payload : boolean true 21/6/2023, 9:18:30 node: ISOFF debug 117 mac2mgtt/Mac-mini-de-Fernando/status/alive msg.payload : boolean false 21/6/2023, 9:18:30 node: ISOFF debug 117 mac2mgtt/Mac-mini-de-Fernando/status/alive: msg.payload : boolean true 21/6/2023, 9:19:31 node: ISOFF debug 117 mac2mqtt/Mac-mini-de-Fernando/status/alive: msg.payload : boolean false 21/6/2023, 9:19:31 node: ISOFF debug 117 mac2mqtt/Mac-mini-de-Fernando/status/alive: msg.payload: boolean true

and here a list of when computer is off:

21/6/2023, 9:05:27 node: ISOFF debug 117 mac2mqtt/Mac-mini-de-Fernando/status/alive msg.payload: boolean false 21/6/2023, 9:09:45 node: ISOFF debug 117 mac2mqtt/Mac-mini-de-Fernando/status/alive mga. pavload : boolean true 21/6/2023, 9:11:09 node: ISOFF debug 117 mac2mqtt/Mac-mini-de-Fernando/status/alive msg.payload: boolean false 21/6/2023, 9:15:30 node: ISOFF debug 117 mac2mqtt/Mac-mini-de-Fernando/status/alive msg.payload : boolean true 21/6/2023, 9:15:32 node: ISOFF debug 117 mac2mgtt/Mac-mini-de-Fernando/status/alive msg.payload: boolean false 21/6/2023, 9:15:32 node: ISOFF debug 117 mac2mqtt/Mac-mini-de-Fernando/status/alive msg.payload: boolean true 21/6/2023, 9:16:51 node: ISOFF debug 117 mac2matt/Mac-mini-de-Fernando/status/alive msg.payload: boolean false

I don't know how this is so erratic for me.
Any thoughts?

Thanks in advance

Open Source License

Hallo Ivan,

is it possible that you release your code with under an open source license?

Yours
Christoph

Fails after a couple of minutes

with

goroutine 20 [running]: main.getBatteryChargePercent(0xc00006eef0, 0x1319948) /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:284 +0x115 main.updateBattery(0x137cc20, 0xc0000fc000) /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:290 +0x85 main.main.func1(0xc00008e3c0, 0x137cc20, 0xc0000fc000, 0xc00008e410) /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:318 +0xe5 created by main.main /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:310 +0x1d0

M2M 1.3.1 on Big Sur 11.5.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.