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

Redis issue #2

Closed
JakeOcean opened this issue Jan 31, 2023 · 11 comments
Closed

Redis issue #2

JakeOcean opened this issue Jan 31, 2023 · 11 comments

Comments

@JakeOcean
Copy link

I am finally getting around to setthing this up. I pulled the repo and the Code is working, I added my car, etc.

I havent setup my tracker yet, but I noticed in the Logs I see

[2023-01-31 16:01:31] develop.ERROR: No such file or directory {"exception":"[object] (RedisException(code: 0): No such file or directory at /home/forge/myDomain.com/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:161)

Repeated over and over again. Have you seen this before?

@eusonlito
Copy link
Owner

Do you have the php-redis extension installed?

@eusonlito
Copy link
Owner

eusonlito commented Jan 31, 2023

Also, configure the redis settings as your current environment at https://github.com/eusonlito/GPS-Tracker/blob/e5f33bb89d24390a9d5bb69cd4547f3f79ae3999/.env.example#L47:L49

Maybe host as localhost and port 6379.

@JakeOcean
Copy link
Author

Yes, it was actually that simple, thank you! -- I had some issues during my composer install and completely forgot to circle back to this

@eusonlito
Copy link
Owner

You can comment any issue (like the composer one) in a new issue to help me to improve setup and usage :)

Thanks!

@JakeOcean
Copy link
Author

@eusonlito have you tested this with the sinotrack st-902 OBD version?

I have updated the server URL using the default sinotrack software, which was a bit of a pain, but not seeing data in my logs.

Is there a good way to test the server port using Curl or something to send it well structered data as a test?

Also, can I leave my server in "debug" mode at all times? What does that actually do?

@eusonlito
Copy link
Owner

Do you have running the server at port 8091? See Server > Status.

Debug mode creates a new log file with debug suffix and store the raw request, valid or invalid.

Check Server > Logs > server folder and search log files by date.

You can test the request open your url from browser like https://domain.com:8091

@eusonlito
Copy link
Owner

Anyway all Sinotrack devices uses the same H02 protocol, it should work as st-901 or st-906.

@eusonlito
Copy link
Owner

After some researching, the ST-902 is using a different protocol named Husbao https://www.traccar.org/forums/topic/decode-obd-data-from-st-902/

I'm going to open a new issue to add support to this protocol, but I need some time to test it.

@eusonlito
Copy link
Owner

Related issue #5

Can you upload the debug log? Some sources say that is the same as H02 protocol.

You can create a new server in your installation with the protocol debug-socket, for example.

@JakeOcean
Copy link
Author

JakeOcean commented Feb 24, 2023

You can create a new server in your installation with the protocol debug-socket, for example.

Yes, will do! My device is not communicating with me now, I think after it wasnt able to connect to the server it takes a few hours to go back to the default server -- but I will let you know when I can test that.

I did notice 1 error in the laravel log, not the server log, not sure if related:

[2023-02-24 06:57:42] develop.ERROR: socket_read(): unable to read from socket [104]: Connection reset by peer {"exception":"[object] (ErrorException(code: 0): socket_read(): unable to read from socket [104]: Connection reset by peer at /home/forge/MyDomain.com/app/Services/Server/Socket/Client.php:69)
[stacktrace]
#1 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /home/forge/MyDomain.com/app/Services/Server/Socket/Client.php(69): socket_read()
#3 /home/forge/MyDomain.com/app/Services/Server/Socket/Client.php(37): App\\Services\\Server\\Socket\\Client->readBuffer()
#4 /home/forge/MyDomain.com/app/Services/Server/Socket/Server.php(176): App\\Services\\Server\\Socket\\Client->handle()
#5 /home/forge/MyDomain.com/app/Services/Server/Socket/Server.php(118): App\\Services\\Server\\Socket\\Server->clientRead()
#6 /home/forge/MyDomain.com/app/Services/Server/Socket/Server.php(88): App\\Services\\Server\\Socket\\Server->read()
#7 /home/forge/MyDomain.com/app/Domains/Server/Action/StartPort.php(105): App\\Services\\Server\\Socket\\Server->accept()
#8 /home/forge/MyDomain.com/app/Domains/Server/Action/StartPort.php(39): App\\Domains\\Server\\Action\\StartPort->serve()
#9 /home/forge/MyDomain.com/app/Domains/Shared/Action/ActionFactoryAbstract.php(52): App\\Domains\\Server\\Action\\StartPort->handle()
#10 /home/forge/MyDomain.com/app/Domains/Server/Action/ActionFactory.php(60): App\\Domains\\Shared\\Action\\ActionFactoryAbstract->actionHandle()
#11 /home/forge/MyDomain.com/app/Domains/Server/Command/StartPort.php(29): App\\Domains\\Server\\Action\\ActionFactory->startPort()
#18 /home/forge/MyDomain.com/vendor/symfony/console/Command/Command.php(312): Illuminate\\Console\\Command->execute()
#20 /home/forge/MyDomain.com/vendor/symfony/console/Application.php(1022): Illuminate\\Console\\Command->run()
#21 /home/forge/MyDomain.com/vendor/symfony/console/Application.php(314): Symfony\\Component\\Console\\Application->doRunCommand()
#22 /home/forge/MyDomain.com/vendor/symfony/console/Application.php(168): Symfony\\Component\\Console\\Application->doRun()
#25 /home/forge/MyDomain.com/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle()
#26 {main}
"}

@eusonlito
Copy link
Owner

Yes, it is a normal error (laravel log) since in PHP it is not possible to know if the client of a socket connection is still connected or not, so you must always try to read (and be prepared for failure).

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

2 participants