[squeak-dev] WebClient httpGet: 'http://freegeoip.net/json/' works on windows not linux

tim Rowledge tim at rowledge.org
Tue Feb 27 18:37:35 UTC 2018



> On 27-02-2018, at 5:42 AM, Louis LaBrunda <Lou at Keystone-Software.com> wrote:
> 
> Hi Guys,
> 
> Thank you all very much.  Now, can someone please tell me what I need to do (please be
> specific) to get this to work on my Raspberry Pi.

OK, this is supposedly simple and yet finding any decent explanation so far eludes me. So let's see if we can develop sometihng that might make sense to include in the swiki or on the bintray page etc.


==========================

If you go to squeak.org you will see the collection of download buttons top-left (I find myself thinking a 'caption' for that group to make it really obvious that it is download related might be nice) and you need to hit the 'More...' button. That takes you to the general downloads page at http://squeak.org/downloads/

Since we just need a new VM package and know that we need the latest one in order to hopefully get this SSL related fix, click on the link icon next to the 'OpenSmalltalk VMs(trunk)' line. We should end up at https://bintray.com/opensmalltalk/vm/cog/201802261515#files

Herein is a long and not very easily interpretable list of files. There *is* a Readme button, which is nice. The content of the readme seems a little in need of improvement; for a start it is apparently the readme for the github source tree rather than something specifically intended to explain the bintray stuff.

Looking down the list of files though I eventually come across a squeak.cog.spur_linux32ARMv6 entry, which pretty much has to be the One. I'm a bit puzzled by the '_itimer' part since that implies use of the interval timer rather than the threaded interrupt, which is what I always use and prefer. I don't know why the autobuild stuff doesn't make that version.

Anyway, if you download that package to your Squeak realted directory (today it's easiest to do 
`wget https://bintray.com/opensmalltalk/vm/download_file?file_path=squeak.cog.spur_linux32ARMv6_itimer_201802261515.tar.gz` in a terminal on your Pi) and extract it (`tar -xzvf download_file?file_path=squeak.cog.spur_linux32ARMv6_itimer_201802261515.tar.gz` and please don't ask me why wget or bintray sticks that stuff in front!) then you should find a directory called 'sqcogspurlinuxhtRPi'.

First thing to do to test that it unpacked properly is to (in that terminal again) run
`./sqcogspurlinuxhtRPi/squeak {my.image}`
Remembering of course that my.image should be replaced by your image name. I have successfully forgotten to do that on occasion.

Assuming it works at all, try your test case in a workspace by printit -
(ReadStream on: (WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: 'https://api.ipify.org') content) content utf8ToSqueak) content
I get 
'{"ip":"173.183.106.150","country_code":"CA","country_name":"Canada","region_code":"BC","region_name":"British Columbia","city":"Qualicum Beach","zip_code":"V9K","time_zone":"America/Vancouver","latitude":49.3468,"longitude":-124.4361,"metro_code":0}
which looks pretty much what you'd want.

If that is all good then you need to move the VM files to wherever you keep your VMs. I always keep them just where they sit in the Squeak directory because I so often have to fiddle. I suspect some unix mavens will be getting hot sweats at this point as they heat up their photon-keyboards to fire weapons grade missives in my direction explaining how you must, must, MUST move your executable fines to... somewhere or other.

Personally I use the Raspbian GUI tool to select an image file, get the menu and choose 'open with...' and then 'Custom Command Line' and browse for the squeak script in sqcogspurlinuxhtRPi as the thing to execute. That way I can do the normal d-click on the image to run it.

========================

All that is stupidly over complicated and it really ought to be made simpler somehow.


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: NBRM: Unconditional No BRanch Multiple




More information about the Squeak-dev mailing list