FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
166 views 0 comments
by anonymous

So for some reason the things I have been doing with JSON RPC on the older firmware versions doesn't work anymore.

I always get error: { code: -32002, message: 'Access denied' }

I know that in versions before 07 I had to enable JSON RPC in the settings, but as far as I know now it should be enabled by default?

I have added permissions to my user in rpcd config:

config login
	option username 'admin'
	option group 'root'
	option password '$p$admin'
	list read '!superuser'
	list read '*'
	list write '!superuser'
	list write '*'
	option _dummy_time '1653471475'

Is there anything I'm missing in the latest version?

This is what I'm trying to do with JSON RPC:

{
   jsonrpc: '2.0',
   id: 1,
   method: 'call',
   params: [
      '9f7775131e7ac1aaf2bb96e40a545b61',
      'file',
      'write',
      {
         path: '/overlay/upper/readLoop.sh',
         data: 'for i in $(seq 1 $1); do cat /sys/class/gpio/$2/value; done'
      }
   ]
}

1 Answer

0 votes
by anonymous

Hello,

With the latest firmware revision 00.07.02, JSON RPC should enabled by default.

Best regards,

Žygimantas