AshMartian / homebridge-carwings

9 stars 9 forks source link

INVALID PARAMS #12

Open cyrillopez opened 6 years ago

cyrillopez commented 6 years ago

Hi,

i try to use the homebridge carwings plugin but after homebridge start, i get the error bellow with INVALID PARAMS on the url login request

Do you have any idea to solve my issue ?

Note that i can't modify the region Europe by adding "region": "NE", in config.json settings

[1/20/2018, 10:21:17 PM] Homebridge is running on port 51826.                                                                                                                                   
πŸƒ api InitialApp πŸ‘                                                                                                                                                                            
api UserLoginRequest πŸ‘Ž                                                                                                                                                                         
 { status: 200,                                                                                                                                                                                 
  statusText: 'OK',                                                                                                                                                                             
  headers:                                                                                                                                                                                      
   { date: 'Sat, 20 Jan 2018 22:21:19 GMT',                                                                                                                                                     
     server: 'Apache',                                                                                                                                                                          
     'strict-transport-security': 'max-age=15768000',                                                                                                                                           
     connection: 'close',                                                                                                                                                                       
     'transfer-encoding': 'chunked',                                                                                                                                                            
     'content-type': 'application/json; charset=utf-8' },                                                                                                                                       
  config:                                                                                                                                                                                       
   { adapter: [Function: httpAdapter],                                                                                                                                                          
     transformRequest: { '0': [Function: transformRequest] },                                                                                                                                   
     transformResponse: { '0': [Function: transformResponse] },                                                                                                                                 
     timeout: 0,                                                                                                                                                                                
     xsrfCookieName: 'XSRF-TOKEN',                                                                                                                                                              
     xsrfHeaderName: 'X-XSRF-TOKEN',                                                                                                                                                            
     maxContentLength: -1,                                                                                                                                                                      
     validateStatus: [Function: validateStatus],                                                                                                                                                
     headers:                                                                                                                                                                                   
      { Accept: 'application/json, text/plain, */*',                                                                                                                                            
        'Content-Type': 'application/x-www-form-urlencoded',                                                                                                                                    
        'User-Agent': 'axios/0.15.3',                                                                                                                                                           
        'Content-Length': 128 },                                                                                                                                                                
     baseURL: 'https://gdcportalgw.its-mo.com',                                                                                                                                                 
     method: 'post',                                                                                                                                                                            
     url: 'https://gdcportalgw.its-mo.com/gworchest_160803A/gdc/UserLoginRequest.php',                                                                                                          
     data: 'initial_app_strings=geORNtsZe5I4lRGjG9GZiA&UserId=[[myemail]]&Password=[[seems to be my password encoded]]&RegionCode=NNA' },                                                
  request:              
  Writable {                                                                                                                                                                                   
     _writableState:                                                                                                                                                                            
      WritableState {                                                                                                                                                                           
        objectMode: false,                                                                                                                                                                      
        highWaterMark: 16384,                                                                                                                                                                   
        needDrain: false,                                                                                                                                                                       
        ending: false,                                                                                                                                                                          
        ended: false,                                                                                                                                                                           
        finished: false,                                                                                                                                                                        
        decodeStrings: true,                                                                                                                                                                    
        defaultEncoding: 'utf8',                                                                                                                                                                
        length: 0,                                                                                                                                                                              
        writing: false,                                                                                                                                                                         
        corked: 0,                                                                                                                                                                              
        sync: true,                                                                                                                                                                             
        bufferProcessing: false,                                                                                                                                                                
        onwrite: [Function: bound onwrite],                                                                                                                                                     
        writecb: null,                                                                                                                                                                          
        writelen: 0,                                                                                                                                                                            
        bufferedRequest: null,                                                                                                                                                                  
        lastBufferedRequest: null,                                                                                                                                                              
        pendingcb: 0,                                                                                                                                                                           
        prefinished: false,                                                                                                                                                                     
        errorEmitted: false,                                                                                                                                                                    
        bufferedRequestCount: 0,                                                                                                                                                                
        corkedRequestsFree: [Object] },                                                                                                                                                         
     writable: true,                                                                                                                                                                            
     domain: null,                                                                                                                                                                              
     _events:         
 { response: [Function: handleResponse],                                                                                                                                                   
        error: [Function: handleRequestError] },                                                                                                                                                
     _eventsCount: 2,                                                                                                                                                                           
     _maxListeners: undefined,                                                                                                                                                                  
     _options:                                                                                                                                                                                  
      { maxRedirects: 21,                                                                                                                                                                       
        protocol: 'https:',                                                                                                                                                                     
        hostname: 'gdcportalgw.its-mo.com',                                                                                                                                                     
        port: null,                                                                                                                                                                             
        path: '/gworchest_160803A/gdc/UserLoginRequest.php',                                                                                                                                    
        method: 'post',                                                                                                                                                                         
        headers: [Object],                                                                                                                                                                      
        agent: undefined,                                                                                                                                                                       
        auth: undefined },                                                                                                                                                                      
     _redirectCount: 0,                                                                                                                                                                         
     _onNativeResponse: [Function],                                                                                                                                                             
     _currentRequest:                                                                                                                                                                           
      ClientRequest {    
  domain: null,                                                                                                                                                                           
        _events: [Object],                                                                                                                                                                      
        _eventsCount: 4,                                                                                                                                                                        
        _maxListeners: undefined,                                                                                                                                                               
        output: [],                                                                                                                                                                             
        outputEncodings: [],                                                                                                                                                                    
        outputCallbacks: [],                                                                                                                                                                    
        outputSize: 0,                                                                                                                                                                          
        writable: true,                                                                                                                                                                         
        _last: true,                                                                                                                                                                            
        upgrading: false,                                                                                                                                                                       
        chunkedEncoding: false,                                                                                                                                                                 
        shouldKeepAlive: false,                                                                                                                                                                 
        useChunkedEncodingByDefault: true,                                                                                                                                                      
        sendDate: false,                                                                                                                                                                        
        _removedHeader: [Object],                                                                                                                                                               
        _contentLength: 128,                                                                                                                                                                    
        _hasBody: true,                                                                                                                                                                         
        _trailer: '',                                                                                                                                                                           
        finished: true,                                                                                                                                                                         
        _headerSent: true,                                                                                                                                                                      
        socket: [Object],                                                                                                                                                                       
        connection: [Object],                                                                                                                                                                   
        _header: 'POST /gworchest_160803A/gdc/UserLoginRequest.php HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/x-www-form-urlencoded\r\nUser-Agent: axios
/0.15.3\r\nContent-Length: 128\r\nHost: gdcportalgw.its-mo.com\r\nConnection: close\r\n\r\n',                                                                                                   
        _headers: [Object],                                                                                                                                                                     
        _headerNames: [Object],                                                                                                                                                                 
        _onPendingData: null,                                                                                                                                                                   
        agent: [Object],         
     socketPath: undefined,                                                                                                                                                                  
        timeout: undefined,                                                                                                                                                                     
        method: 'POST',                                                                                                                                                                         
        path: '/gworchest_160803A/gdc/UserLoginRequest.php',                                                                                                                                    
        _ended: true,                                                                                                                                                                           
        res: [Object],                                                                                                                                                                          
        aborted: undefined,                                                                                                                                                                     
        timeoutCb: null,                                                                                                                                                                        
        upgradeOrConnect: false,                                                                                                                                                                
        parser: null,                                                                                                                                                                           
        maxHeadersCount: null,                                                                                                                                                                  
        _redirectable: [Circular] },                                                                                                                                                            
     _currentUrl: 'https://gdcportalgw.its-mo.com' },                                                                                                                                           
  data: { status: '-2010', message: 'INVALID PARAMS' } }                                                                                                                                        
Error                                                                                                                                                                                           
    at /usr/local/lib/node_modules/homebridge-carwings/node_modules/carwings/lib/index.js:17:13                                                                                                 
    at Generator.next (<anonymous>)                                                                                                                                                             
    at step (/usr/local/lib/node_modules/homebridge-carwings/node_modules/carwings/lib/index.js:42:191)                                                                                         
    at /usr/local/lib/node_modules/homebridge-carwings/node_modules/carwings/lib/index.js:42:361                                                                                                
    at process._tickCallback (internal/process/next_tick.js:109:7)          

My parameters in config.json

{
    "accessory": "Carwings",
    "name": "Leaf",
    "email": "[[my email]]",
    "password": "[[my password not encoded]]",
    "region": "NE",
    "updateInterval": "never"
    }

Regards Cyril

ciaronfitz commented 6 years ago

Hi! I’m very new to this, but had the same issue... it’s fairly easy to fix. I used the desktop of my pi to enter the Homebridge-carwings directory. It’s: Opt/nodejs/lib/node_modules/Homebridge-carwings/node_modules/carwings/

There are two index.js files. One in the lib folder and one in the src folder.

In each of the index files you’ll find the defaultRegionCode set as NNA. Change both to NE.

That fixed the issue for me and will hopefully fix it for you too.

cyrillopez commented 6 years ago

Hi Ciaronfitz Thanks for help but i use container docker from qnap and it's seems that the folders are not the same or that i am not sure how to access them Cyril

ciaronfitz commented 6 years ago

Ah, I see. I’ve no experience of that sorry! :(

cyrillopez commented 6 years ago

I found the path for the two files but any idea how to modify them /usr/local/lib/node_modules/homebridge-carwings/node_modules/carwings/lib/index.js /usr/local/lib/node_modules/homebridge-carwings/node_modules/carwings/src/index.js

cyrillopez commented 6 years ago

i succesfully modify the two files but i have still the error @ciaronfitz do you have modify any other line ?

ciaronfitz commented 6 years ago

No, those were the only two I had problems with. Not sure what could be causing the issue πŸ€”

BartoX360 commented 6 years ago

I have the same issue :(

FirePT commented 6 years ago

Me too, NE region also...

zthomasp commented 5 years ago

Me three