Another Newbie Question

Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Another Newbie Question

birdrock
Ok, now I have a very practical question.

My colleagues and I are writing code on the Raspberry Pi that reads sensors and broadcasts that sensor data to a server.

So I have this wild thought.  I could run Amber on nodejs on Raspbian.  If Amber can call a simple Python script that interfaces with the sensor, then Amber could package the resulting data and send it on to the server.  (Or, alternately, perhaps nodejs has driver code for that sensor, but that may not be so).

I know it sounds a little complex, but I think it would make an interesting proof of concept for using Smalltalk in the IoT space.

Any thoughts?

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Another Newbie Question

birdrock
Thanks.  I also found a nice node I2C binding, which apparently works well with the RPi.  So anything you can put on the I2C bus, Smalltalk can probably interact with!


On Friday, June 29, 2018 at 3:46:53 PM UTC-5, Herby wrote:


<a href="javascript:" target="_blank" gdf-obfuscated-mailto="LbE92YdoCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">bird...@... wrote on 29. 6. 2018 22:21:

> Ok, now I have a very practical question.
>
> My colleagues and I are writing code on the Raspberry Pi that reads
> sensors and broadcasts that sensor data to a server.
>
> So I have this wild thought.  I could run Amber on nodejs on Raspbian.  
> If Amber can call a simple Python script that interfaces with the
> sensor, then Amber could package the resulting data and send it on to
> the server.  (Or, alternately, perhaps nodejs has driver code for that
> sensor, but that may not be so).

Anything you can do in node you can do in Amber.

Install Amber for development (as described in amber git) somewhere and
look at AmberCli package where there are samples of calling outside
script via spawn/fork node API (in code that does `amber init`
functionality).

> I know it sounds a little complex, but I think it would make an
> interesting proof of concept for using Smalltalk in the IoT space.
>
> Any thoughts?
>
> --
> You received this message because you are subscribed to the Google
> Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="LbE92YdoCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">amber-lang+...@googlegroups.com
> <mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="LbE92YdoCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">amber-lang+unsubscribe@...>.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Another Newbie Question

Herby Vojčík
The old github wiki contains a few pages which could be migrated.

Like
https://github.com/amber-smalltalk/amber/wiki/From-smalltalk-to-javascript-and-back.

:-)

Herby

[hidden email] wrote on 29. 6. 2018 23:25:

> Thanks.  I also found a nice node I2C binding, which apparently works
> well with the RPi.  So anything you can put on the I2C bus, Smalltalk
> can probably interact with!
>
>
> On Friday, June 29, 2018 at 3:46:53 PM UTC-5, Herby wrote:
>
>
>
>     [hidden email] <javascript:> wrote on 29. 6. 2018 22:21:
>      > Ok, now I have a very practical question.
>      >
>      > My colleagues and I are writing code on the Raspberry Pi that reads
>      > sensors and broadcasts that sensor data to a server.
>      >
>      > So I have this wild thought.  I could run Amber on nodejs on
>     Raspbian.
>      > If Amber can call a simple Python script that interfaces with the
>      > sensor, then Amber could package the resulting data and send it
>     on to
>      > the server.  (Or, alternately, perhaps nodejs has driver code for
>     that
>      > sensor, but that may not be so).
>
>     Anything you can do in node you can do in Amber.
>
>     Install Amber for development (as described in amber git) somewhere and
>     look at AmberCli package where there are samples of calling outside
>     script via spawn/fork node API (in code that does `amber init`
>     functionality).
>
>      > I know it sounds a little complex, but I think it would make an
>      > interesting proof of concept for using Smalltalk in the IoT space.
>      >
>      > Any thoughts?
>      >
>      > --
>      > You received this message because you are subscribed to the Google
>      > Groups "amber-lang" group.
>      > To unsubscribe from this group and stop receiving emails from it,
>     send
>      > an email to [hidden email] <javascript:>
>      > <mailto:[hidden email] <javascript:>>.
>      > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Another Newbie Question

birdrock
Thanks for that reference!  If I do get to use Amber with our project, I will be documenting the process.

The nodejs i2c example fragment looks like this:

const raspi = require('raspi');
const I2C = require('raspi-i2c').I2C;

raspi.init(() => {
const i2c = new I2C();
console.log(i2c.readByteSync(0x18)); // Read one byte from the device at address 18
});

So, I think the Amber version would look something like:

|raspi|
raspi := require value: 'raspi'.

raspi init: self callbackMethod.

(etc)

..................................
callbackMethod (takes no messages)
..................................
|I2C i2c address byte|
address := 0x29.
I2C := require value: 'raspi-i2c' I2C.
i2c := I2C new.
byte := i2c readByteSync: address.



On Friday, June 29, 2018 at 2:59:38 PM UTC-7, Herby wrote:
The old github wiki contains a few pages which could be migrated.

Like
<a href="https://github.com/amber-smalltalk/amber/wiki/From-smalltalk-to-javascript-and-back" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Famber-smalltalk%2Famber%2Fwiki%2FFrom-smalltalk-to-javascript-and-back\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFEoAvzKjJ20Ozb5129ypzW2j5ZSw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Famber-smalltalk%2Famber%2Fwiki%2FFrom-smalltalk-to-javascript-and-back\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFEoAvzKjJ20Ozb5129ypzW2j5ZSw&#39;;return true;">https://github.com/amber-smalltalk/amber/wiki/From-smalltalk-to-javascript-and-back.

:-)

Herby

<a href="javascript:" target="_blank" gdf-obfuscated-mailto="WD9YOIBsCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">bird...@... wrote on 29. 6. 2018 23:25:

> Thanks.  I also found a nice node I2C binding, which apparently works
> well with the RPi.  So anything you can put on the I2C bus, Smalltalk
> can probably interact with!
>
>
> On Friday, June 29, 2018 at 3:46:53 PM UTC-5, Herby wrote:
>
>
>
>     [hidden email] <javascript:> wrote on 29. 6. 2018 22:21:
>      > Ok, now I have a very practical question.
>      >
>      > My colleagues and I are writing code on the Raspberry Pi that reads
>      > sensors and broadcasts that sensor data to a server.
>      >
>      > So I have this wild thought.  I could run Amber on nodejs on
>     Raspbian.
>      > If Amber can call a simple Python script that interfaces with the
>      > sensor, then Amber could package the resulting data and send it
>     on to
>      > the server.  (Or, alternately, perhaps nodejs has driver code for
>     that
>      > sensor, but that may not be so).
>
>     Anything you can do in node you can do in Amber.
>
>     Install Amber for development (as described in amber git) somewhere and
>     look at AmberCli package where there are samples of calling outside
>     script via spawn/fork node API (in code that does `amber init`
>     functionality).
>
>      > I know it sounds a little complex, but I think it would make an
>      > interesting proof of concept for using Smalltalk in the IoT space.
>      >
>      > Any thoughts?
>      >
>      > --
>      > You received this message because you are subscribed to the Google
>      > Groups "amber-lang" group.
>      > To unsubscribe from this group and stop receiving emails from it,
>     send
>      > an email to amber-lang+...@googlegroups.com <javascript:>
>      > <mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="WD9YOIBsCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">amber-lang+unsubscribe@... <javascript:>>.
>      > For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout
>     <<a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="WD9YOIBsCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">amber-lang+...@googlegroups.com
> <mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="WD9YOIBsCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">amber-lang+unsubscribe@...>.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.