1

Update Mileage or sensor on Wialon_api Python

Тема: Update Mileage or sensor on Wialon_api Python

Hi,

I try to use Wialon_api on Python, I don't have any problem for login, to search account informations, unit et sensor informations.
But not possible, to update for example mileage counter. I tried this code, but I j have a WialonError (Access denied unit_update_mileage_counter (7))

I use this code:

        result = wialon_api.unit_update_mileage_counter(itemId=unitId, newValue=newValue)

Do you have a sample to update sensor and mileage ?

Regards

2

Update Mileage or sensor on Wialon_api Python

Re: Update Mileage or sensor on Wialon_api Python

Hi!

error 7 means that there is not access right to change mileage value.
Please check if you have the access rights to unit  - https://help.wialon.com/help/wialon-hos … s/unit-acl
Also please check the token access rights - https://sdk.wialon.com/wiki/en/sidebar/ … ogin/login
the default value is 0x100  only for viewing, so you need to get token with full access right (parameter access_type), for example
https://hosting.wialon.com/login.html?access_type=-1

Diana Cheley
Wialon Hosting Expert
Gurtam
3

Update Mileage or sensor on Wialon_api Python

Re: Update Mileage or sensor on Wialon_api Python

Hi Diana,

Thanks a lot, it's ok, now.

Regards,
Pascal