Skip to content
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

Need additional information for traccar_pusher using gotify #1

Open
blobb999 opened this issue Oct 24, 2021 · 6 comments
Open

Need additional information for traccar_pusher using gotify #1

blobb999 opened this issue Oct 24, 2021 · 6 comments

Comments

@blobb999
Copy link

Thanks a lot for the script and effort, unfortunately i need some additional information, idk how to run it from Traccar.
I configured it in traccar.xml this way:
<entry key='event.forward.url'>http://localhost:8082/push.php</entry>

Traccar serverlog:
WARN: Event forwarding failed - MessageBodyReader not found for media type=application/octet-stream, type=class java.lang.Object,...

The values can be set directly in the code or if i enable the debugging lines, it uses a data.txt config file and needs the format like this?

"push" 1
"gotify" 1
"pushover" 0
"pushonline" 0
"pushalarm" 0
"pushoffline" 0
"pushunknown" 0
"pushmoving" 0
"pushurl" http://localhost:90/
"GotifyApiKey" MyAppTokenXYZ

follow up from: gotify/server#444

@neo7530
Copy link
Owner

neo7530 commented Oct 25, 2021

Hey,

you have to add:

<entry key='event.forward.enable'>true</entry>
<entry key='event.forward.url'>https://WEBSERVER.URL/PATH/</entry>
<entry key='event.forward.header'>Content-Type: application/json; charset=utf-8</entry>

in /opt/traccar/config/traccar.xml

Then you have to start a webserver (apache etc.) and put the push.php as index.php in your "https://WEBSERVER.URL/PATH/".

Next configure your User-Settings as seen in the PIC i've attached
TRACCAR PUSH
.
Thats it.

@blobb999
Copy link
Author

Thank you very much for the help. I set it up exactly described above and still get follow Warning:
WARN: Event forwarding failed - MessageBodyReader not found for media type=text/html;charset=utf-8, type=class java.lang.Object, genericType=class java.lang.Object. - MessageBodyProviderNotFoundException (...)

Gotifiy Serverlogs shows nothing from Traccar.

Maybe something changed since you did the PHP script? Traccarlog shows
2021-10-25 11:50:35 INFO: Version: 4.13
2021-10-25 11:50:35 INFO: Starting server...

@neo7530
Copy link
Owner

neo7530 commented Oct 25, 2021

2021-10-25 12:10:38 INFO: Character encoding: UTF-8 charset: UTF-8
2021-10-25 12:10:38 INFO: Version: 4.7
2021-10-25 12:10:38 INFO: Starting server...

@blobb999
Copy link
Author

Ahhh here we are... this could it be? One line above i have:
2021-10-25 12:25:04 INFO: Character encoding: Cp1252 charset: windows-1252

<entry key='event.forward.header'>Content-Type: application/json; charset=windows-1252</entry>
...is helping not, is ignored. Same Warning....

Maybe there is a workaround? For example... where do i have to add this in your PHP script to enforce Traccar´s encoding?

header('Content-type: application/json; charset=windows-1252');
echo json_encode( $data );

@neo7530
Copy link
Owner

neo7530 commented Oct 25, 2021

This has nothing to do with my script. This is just a json parser...

@l-e-o-n-c-e
Copy link

Hi, I have exactly the same issue when pushing the events to ft ( https://github.com/jpmens/from-traccar ), so for me the issue is on traccar's side definitely. The error raises during traccar startup, at this point there is no communication with the destination server.
I haven't found a solution yet :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants