Unable to acquire request token from Twitter

20 replies [Last post]
kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
I would be very grateful if someone could test if Twitter is fully functional. I am getting the message below when I click on the "Authorise with Twitter button".
"Unable to acquire request token from Twitter"
"Acquiring a request token failed"
I have recently made some changes to my HAH and am not sure if these are affecting Twitters operation.
I use HAH Twitter to send me a SMS if my burglar/fire alarm are triggered.
Firmware Build: 311/3.4
Many thanks in advance.
kema
allanayr
Offline
Ayr, United Kingdom
Joined: 25 Sep 2011
I know twitter was working

I know twitter was working for me a couple of months ago becaue I used it to adjust my heating while I was away. But I have tried to use it a couple of times recently and it is broken for me as well. Also using 311/3.4

 

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Was working on the 23 Jan

Alan many thanks for your prompt reply, after looking at my records I can confirm it was working on the 23rd January at 17:50.

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
I wonder if this the

I wonder if this the problem? 

Tomorrow (Jan 14, 2014) all requests to  will be restricted to SSL only. Read more: 

Although the dates don't seem to match exactly. 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
If it was working & nothing has changed it must be twitter.

If it was working and nothing has changed then it must be twitter (AGAIN).

God damn it.  More busy work just to keep up with vendors who constantly screw with their API's.
Why do they do this?   *sigh*  Let me have a look (again).   I did make changes the last time they mess around with  all this, now they are doing it again.

UPDATE:  I ran some tests and I found that http:// connections to twitter always return a 403.  I've update xap-twitter to use https:// and now its working again.  I guess the grace period for doing this is over and twitter are enforcing it.
Anyway all fixed in 311.6 beta - if you've not migrated do read http://www.homeautomationhub.com/content/and-coming-changes which has some background about some of the changes.

Brett

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Possibly still the same.

Brett many thanks for your fast response into looking into the Twitter problem.

I have installed 311.6 beta firmware, unfortunatley I still encounter the same problem with Twitter.

"Unable to acquire request token from Twitter

Acquiring a request token failed"

I am a relative novice to the HAH platform and may have missed an important point when installing beta firmware (Especially as there have been many changes with this beta version).

I would be grateful if someone else could verify if they have the same issue with 311.6.

One other thing I noticed was that cron was not working, I guess this could be possibly something to do with timezones. I will investigate further.

Many thanks.

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Kema,I haven't tried the

Kema,

I haven't tried the update yet (will try have a go later) but looking through the changes Brett has made today, I believe this should fix functionality for those already authorised with Twitter, not sure the authorise button via Kloned is fixed yet though. This might explain what your seeing.

ill see if I can test the update but I'm running on a Pi at the moment and cannot just run the update-dev command like I used too!.

 

Garry

 

Edit: can confirm twitter now working on an already authorised system. Cannot test authorisation as I don't have Kloned, but like I say I suspect this still broken. 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Thanks Gary... I never

Thanks Gary... I never checked that the Authorization service is still working

UPDATE: 311.7 - the twitter auth from the web page is good now.
It getting time to push this as 312 given stuff like this has to be fixed.

Brett

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
That was quick.

Brett / Garry I can confirm Twitter is now fully functional in both directions with 311.7 firmware.

Unfortunately the fly in the ointment is, I cannot get cron and googlecal to trigger any relays / rf devices. Please let me know if you would like me to carry out any debugging.

 

I must thank you once again for resolving the twitter problem so quickly.

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Kema thanks for the

Kema thanks for the confirmation.   googlecal is a bit of a sad story the library that I've been using has not had any updates since 2011 http://code.google.com/p/libgcal/source/list so I'm thinking either a) I have to debug this library myself or b) switch to a supported gcal framework which means another language and as space is VERY tight on the livebox that might be problematic c) give it up as dead  :(   I'm still pondering the effort reluctantly.

Cron should however still be fully functionaly.

1. Make sure cron is enabled  http://livebox/services.kl1
# cat /etc/xap.d/system.ini
<other bits removed>
[cron]
enable=1

2. Get a command line prompt and check for a crond process with 'ps'
# ps | grep crond
  203 root      1808 S    crond
  219 root      1800 R    grep crond

3. Check there is a linkage in /var/spool/cron.
# ls -l /var/spool/cron
lrwxrwxrwx    1 root     root           13 Jan  1  1970 crontabs -> /etc/crontabs

Make sure this points to a /etc/crontabs directory if you have someting setup you'll see a file called 'root'
# ls -l /etc/crontabs/
-rw-------    1 root     root           25 Jan 30 09:25 root

4. Paste in the output /etc/crontabs/root so we can see what you have.

Brett

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
311.7 beta update.

Brett.

Many thanks for the detailed explanation, regarding the issues with Googlecal. I now and I am sure others fully appreciate the difficulties involved in getting this working. The spin off for me is I am now getting quite proficient with vi.

This weekend I hope to have more time to evaluate 311.7 and get cron working. Thankyou for the instructions. I will update you when I have further information.

I am a bit confused with the future evolution of the Livebox, Am I correct In thinking that we will have the option of being able to use the Pi or the Beagle Bones as the hardware platform.

Very grateful for your help.

 

Kema.

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Future direction

Well, I've talked to Brett about this a fair bit over the last month or two. The Livebox as a platform is kinda getting a bit hard to come by and its lack of space is beginning to limit the extra things that might be done.

However, I'm keen not to lose some of the core 'addon offerings' that come with the HAH PCB. Platform wise, I reckon that the Rasp Pi should be a focus. Simply because there are a lot of them out there. BeagleBone too as it's just another xcompile.

I'm playing with an idea to make an ethernet connected version of the HAH PCB. Same relays/inputs/RF Tx and 1-Wire ... but in a standalone, xAP compliant unit.

Hard to really know if there would be demand for such a thing ...

Derek.

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Derek, I agree that moving to

Derek, 

I agree that moving to other platforms will help with the longevity of the project and open up the project to a wider audience. 

I can't talk for the beaglebone but certainly moving HAH onto the pi would not render the HAH pcb useless.

With absolutely no changes to the code and just the price of a gpio breakout board (<£3) I have the pcb working fine. Work in progress pic attached .

An Ethernet version would open up other possibilities but like you say, difficult to guage what the demand would be. 

Garry

AttachmentSize
image.jpg 43.89 KB
kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Still no joy with cron (beta 311.7)
Brett I have managed to find an hour this morning, to have another go at getting cron working on my HAH. 
Unfortunatley cron still fails me.
Here are the results from what you asked me to do:-
1
[cron]
enable=1
2
# ps | grep crond
149 root      1812 S    crond
199 root      1800 R    grep crond
3
# ls -l /var/spool/cron
lrwxrwxrwx    1 root     root           13 Jan  1  1970 crontabs -> /etc/crontabs
# ls -l /etc/crontabs/
-rw-------    1 root     root          826 Jan 31 08:18 root
4
# crontab -l
19 08 * * * aliasmsg "rf 1 on"
30 23 * * * aliasmsg "rf 4 off"
20 21 * * * aliasmsg "rf 4 on"
21 21 * * * aliasmsg "rf 4 on"
00 16 * * * aliasmsg "rf 5 on"
01 16 * * * aliasmsg "rf 5 on"
00 21 * * * aliasmsg "rf 5 off"
00 23 * * * aliasmsg "rf 5 off"
45 07 * * * aliasmsg "relay 2 on"
15 08 * * * aliasmsg "relay 2 off"
46 07 * * * aliasmsg "relay 1 on"
00 09 * * * aliasmsg "relay 1 off"
00 16 * * * aliasmsg "relay 1 on"
50 20 * * * aliasmsg "relay 1 off"
00 22 * * * aliasmsg "relay 1 off"
20 08 * * * aliasmsg "relay 2 off"
30 23 * * * aliasmsg "allOFF"
31 23 * * * aliasmsg "allOFF"
32 23 * * * aliasmsg "allOFF"
31 23 * * * aliasmsg "relay 2 off"
31 18 * * 3 aliasmsg "relay 1 off"
40 20 * * 3 aliasmsg "relay 1 on"
01 22 * * 3 aliasmsg "relay 1 off"
00 08 * * 6 aliasmsg "relay 3 on"
01 08 * * 6 aliasmsg "relay 3 off"
Hope this helps.
garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Kema,Is it definitely Cron

Kema,

Is it definitely Cron that is the issue? Do your alias commands work straight from the command line?

 

Garry

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Getting closer

Garry it looks like you are correct regarding alias commands not working. Please see the response below I get from   aliasmsg "rf 2 off"

# aliasmsg "rf 2 off"

/usr/bin/lua: /usr/share/lua/5.1/xap/init.lua:449: attempt to index global 'stringx' (a nil value)

stack traceback:

        /usr/share/lua/5.1/xap/init.lua:449: in function 'getDeviceID'

        /usr/share/lua/5.1/xap/init.lua:460: in function 'buildXapAddress'

        /usr/share/lua/5.1/xap/init.lua:108: in function 'init'

        /usr/bin/aliasmsg:21: in main chunk

        [C]: ?

#

I hope I have not or should have done, something very basic when performing the upgrade.

Many thanks for your help.

brett
Offline
Providence, United States
Joined: 9 Jan 2010
The stringx is my bad - this

The stringx is my bad - this happend when I moved to using the 'hostname' instead of defaulting to livebox as I added a new function into xap/init.lua which used stringx and I didn't explicity require the module.

Although this fixed aliasmsg I also found that I could not run bscmsg due to a bug in the penlight library so I uplifted that as well.

released:  311.8

Brett

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
311.8 plugboard stopped by jeenodeApplet V4

Brett

I have installed 311.8 which has cured the  # aliasmsg "rf 2 off" command. But when I introduce the new Jeenode Applet(V4)  to /etc/plugboard, the Plugboard itself stops working.

Here is the message in the Plugboard log.

lua: /etc/plugboard/jeenodeApplet.lua:33: attempt to call global 'IRNode' (a table value)

stack traceback:

       /etc/plugboard/jeenodeApplet.lua:33: in main chunk

       [C]: in function 'require'

       /etc_ro_fs/plugboard/plugboard.lua:23: in function 'fun'

       /usr/share/lua/5.1/pl/tablex.lua:409: in function 'foreach'

       /etc_ro_fs/plugboard/plugboard.lua:66: in main chunk

       [C]: ?

Loading /etc/plugboard/NEWaliasApplet.lua       [ Alias Interpreter ]

Loading /etc/plugboard/jeenodeApplet.lua

 

Hope this helps.

kema

brett
Offline
Providence, United States
Joined: 9 Jan 2010
If you are not using the

If you are not using the IRnode then just comment out this line in your jeenodeApplet.lua

--IRNode = require("xap.irnode")

I will fix this in the next beta drop.  If you are using the IR node let me know and I'll push up the beta sooner.
Its a bug in the decoder it doesnt return the class like the other now do.

If you are using it then you can workaround the bug (until the next beta drop) like this:
IRNode = require("xap.irnode").IRNode

Brett

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Looking better

Brett

Not using the IR node, currently only using 1 roomnode.

So I have removed the following lines from the applet

[3] = RoomNode{instance="jeenode:basement", endpoints={temp=1,lobat=1}, ttl=900},

[4] = OutputNode{instance="jeenode:bedroom",endpoints={p1="light",p2="heater",p3="amp",p4=0}},

[5] = IRNode{instance="jeenode:ir"},

[6] = BoilerNode{instance="jeenode:boiler", endpoints={temp=1}, ttl=360},

[7] = BlueNode{instance="bluetooth:presence"}the jeenodeapplet

only leaving the roomnode (2) in the applet

[2] = RoomNode{instance="jeenode:attic", endpoints={temp=1,light=1}, ttl=360}, 

Now I get no errors in the plugboard log.

I did see in the Twitter log the following though:-

Twitter Connector for xAP v12

Copyright (C) DBzoo 2009

 

[err][tcurl.c:292:getLatestTweet] Not enough tokens where provided to parse:

[err][tcurl.c:292:getLatestTweet] Not enough tokens where provided to parse:

[err][tcurl.c:292:getLatestTweet] Not enough tokens where provided to parse:

[err][tcurl.c:292:getLatestTweet] Not enough tokens where provided to parse:

[err][tcurl.c:292:getLatestTweet] Not enough tokens where provided to parse:

[err][tcurl.c:292:getLatestTweet] Not enough tokens where provided to

I can confirm that Twitter is functional in both directions despite the above error.

I still have further testing of my setup, but cannot report any other problems at this stage.

 

kema

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Kema,The error you are

Kema,

The error you are getting out of twitter indicates that an internal array ran out of room after parsing all the tokens it could hold.   This was set to 60 tokens,  I've increased this to 100.   The reason it worked even thou you get this error is because the token we are after was in this batch of 60.   Still we don't want the error as it will fill up the logs and eventually crash the livebox out.  So even thou its benign it can have a nasty side effect if not dealt with.

Brett

Hardware Info