This forum is a read-only archive. Posting, accounts and search are no longer available.
1 / 57
Dec 2015

This thread is for Openhybrid development for the Raspberry pi
Specific continuation of First step to install Open Hybrid on raspberry pi?
This thread will be mainly dealing with the development of hardware interface and libraries for Raspberry Pi B+ model

Frequent Posters

@valentin Should there be a HybridObject library for the raspberry pi ?
should the existing cpp library be used with a python adapter on the pi or should a new python library be built ?

@V_Mohammed_Ibrahim I think this work has to go hand in hand with the API optimizations Carsten is doing right now.
You can already see with his code that it is a lot easier to write a hardware adapter.
In the end you will have the choice to just write your GPIO interfaces right with the hardwareinterface API or if you want to build another bridge to something outside.

If you feel like python is the way to go and a common tool to program things on the PI, yes then maybe a python interface would be nice.

I don’t think you should use the existing HybridObject library. It is optimized for the Atmega processor and its capabilities. For example half of that library is dealing with minimizing the serial data communication by using lookuptables and dealing with string inputs matching to array indexes and all kinds of data allocations. The other half deals with synchronizing between two “computers” (atmega and atheros) that have very different boot up timings. In python you might be able to just interface with the hardware interface API directly.
There are a lot of examples online on how to bridge between nodejs and python.

Since python is more commonly used on the pi , i think it would be better that the libraries be in python
i will begin working on the library along with the interface

Yeah ! i have seen it, the mapping makes it easy to use the GPIO using the physical pin numbering
i have collected some others also like this one that will be useful in designing the interface

Your node.js version is probably to old.
Your log says v0.6.19 that is from 2012.
Try something >v0.10.28. The yun is currently running with v0.10.33.

node -v returns v4.0.0 , but the npm install fails and log still shows “node -v0.6.19”

UPDATE : after restarting the pi and giving npm install i get this

>  pi@raspberrypi ~/Desktop/object $ npm install
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io/node_modules/socket.io-parser requires debug@'0.7.4' but will load
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io/node_modules/debug,
> npm WARN unmet dependency which is version 2.1.0
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io-client/node_modules/engine.io-client requires debug@'1.0.4' but will load
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io-client/node_modules/debug,
> npm WARN unmet dependency which is version 0.7.4
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io-client/node_modules/engine.io-client requires parseuri@'0.0.4' but will load
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io-client/node_modules/parseuri,
> npm WARN unmet dependency which is version 0.0.2

Try to change serialport to “^2.0.5” in the package.json file.
With this change I could run npm install and the server with no errors on a mac with the latest node.js.
You might find more about node.js / socket.io and the PI online. Its an ARM system and might need different installations.

i changed the serialport to “^2.0.5” but then it resulted in a different set of errors

serialport.target.mk:90: recipe for target 'Release/obj.target/serialport/src/se                                       rialport.o' failed
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
make: Leaving directory '/home/pi/Desktop/object/node_modules/serialport/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_                                       modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces                                       s.js:200:12)
gyp ERR! System Linux 3.18.11+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_mod                                       ules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/pi/                                       Desktop/object/node_modules/serialport/build/Release/node-v46-linux-arm/serialpo                                       rt.node" "--module_name=serialport" "--module_path=/home/pi/Desktop/object/node_                                       modules/serialport/build/Release/node-v46-linux-arm"
gyp ERR! cwd /home/pi/Desktop/object/node_modules/serialport
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local                                       /lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-                                       build --module=/home/pi/Desktop/object/node_modules/serialport/build/Release/nod                                       e-v46-linux-arm/serialport.node --module_name=serialport --module_path=/home/pi/                                       Desktop/object/node_modules/serialport/build/Release/node-v46-linux-arm' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/pi/Desktop/object                                       /node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:817:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/chi                                       ld_process.js:211:5)
node-pre-gyp ERR! System Linux 3.18.11+
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/pi/Desktop/object/node_mo                                       dules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/Desktop/object/node_modules/serialport
node-pre-gyp ERR! node -v v4.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.13
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modu                                       les/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/Desktop                                       /object/node_modules/serialport/build/Release/node-v46-linux-arm/serialport.node                                        --module_name=serialport --module_path=/home/pi/Desktop/object/node_modules/ser                                       ialport/build/Release/node-v46-linux-arm' (1)
npm ERR! Linux 3.18.11+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.2
npm ERR! code ELIFECYCLE
npm ERR! serialport@2.0.5 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@2.0.5 install script 'node-pre-gyp install --f                                       allback-to-build'.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /home/pi/Desktop/object/npm-debug.log
pi@raspberrypi ~/Desktop/object $ sudo apt-get install node-pre-gyp install --fallback-to-build
E: Command line option --fallback-to-build is not understood
pi@raspberrypi ~/Desktop/object $ sudo apt-get install node-pre-gyp
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package node-pre-gyp

There is some good documentation for how to install nodejs serialport on the PI here:
https://www.npmjs.com/package/serialport 9

Other then this, if you have some time to wait. Carsten works a lot on improving the structure of the hardwareinterface. I think that you would benefit from waiting until that part is ready to be used.

Meanwhile if you really want to build the python bridge, try to experiment with some simple node.js example first. If you feel save with a good method, then it makes sense to work with the server code.

I looked up in the site and installed the required node js , one module was different for ARM ,after that the errors are gone
now there are only these warnings

> pi@raspberrypi ~/Desktop/object $ npm install
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io/node_modules/socket.io-parser requires debug@'0.7.4' but will load
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io/node_modules/debug,
> npm WARN unmet dependency which is version 2.1.0
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io-client/node_modules/engine.io-client requires debug@'1.0.4' but will load
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io-client/node_modules/debug,
> npm WARN unmet dependency which is version 0.7.4
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io-client/node_modules/engine.io-client requires parseuri@'0.0.4' but will load
> npm WARN unmet dependency /home/pi/Desktop/object/node_modules/socket.io-client/node_modules/parseuri,
> npm WARN unmet dependency which is version 0.0.2

Giving a " node server.js " within the folder or " node object" from outside the folder gives this

pi@raspberrypi ~/Desktop/object $ node server.js
module.js:111
    throw e;
          ^
SyntaxError: Error parsing /home/pi/Desktop/object/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/package.json: Unexpected end of input
    at Object.parse (native)
    at readPackage (module.js:107:52)
    at tryPackage (module.js:117:13)
    at Function.Module._findPath (module.js:183:18)
    at Function.Module._resolveFilename (module.js:334:25)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/pi/Desktop/object/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/lib/index.js:5:12)
    at Module._compile (module.js:460:26)

@V_Mohammed_Ibrahim You might find an interesting learning adventure to understand a bit more how to read these debug messages and then find a solution by your self.

For example you see in this message that something was not parsed rightfully in the node_modules folder.
The module is socket.io as you can see being the next subfolder.

The wrong parsing could be from the server code or from your installation.
Try out a small test project with socket.io and see if the error repeats.

If it does you have a broken installation.
If you google socket.io and raspberry PI then you might find some answers that could help you?
You can try to install socket.io globally:
npm install -g socket.io

If it does not, something in server.js is going wrong.
Maybe there is an issue with a version of socket.io?

It needs to be debugged. This is 90% of the work you need to do when you build something that was not there before. Start with small experiments first until you reached the point where you understand what is happening in the full picture. Try to break problems down in to their components until you have reached what is going wrong.

I want to encourage you to learn more on how to solve these error messages by your self.
You will learn a lot about how to debug node.js code.

@valentin All errors have been removed and the server executed successfully

i had earlier removed the Arduino yun interface from the folder, i replaced the folder with a new copy from github and then did npm install
all dependencies got installed successfully , didnt have to change the serialport in package.json

Now that the server is working , i can start on developing the hardware interface code

1. I think there should be a python module similar to the “HybridObject” library for the yun , that the user can then import when programing the GPIO

2. Then the hadwareinterface to communicate to the server

@valentin How should i proceed with building these? What should be my first steps

I think some good first steps are:

  1. Research online all methods on how to bridge/communicate between node.js and python.
  2. With every researched option, make a small individual node.js experiment outside from the greater open hybrid server code. This is the best way for you to understand what is really needed and how it works.
  3. By the time you are done with step 1 and 2 the new hardwareInterface API should be ready and with your new know how you will be able to implement the pyhton hardwareInterface.

What do you think?

Yeah that is good , i have already collected some materials for it , what do you think we can do about the “digital only” nature of the PIs pins , i saw that we need DAC to use analog output

I believe that this should not be a problem of the hardwareInterface but rather a problem in python. You will most likely find solutions for this problem in the PI/python communities.
For the hardwareInterface you basically want to extend the new hardwareInterface in to the python environment.

In python one should den be able to:

  1. Add new IO points within a setup and go function.
  2. Have some sort of listener or callback for when data from the IO points is coming in
  3. Write data to the IO points
  4. Allow to flip developer functions on and off.

I have some materials , and is researching on ways to interrface nodejs and python,while the new API is getting ready @KevinOrtman
The gpio using python is not ready yet , there are nodejs GPIO methods available as Carsten mentioned
but you can add the objects to hybrid object server and connect to the reality editor
if you are intrrested you can play around with making AR elements like line graph,bar graph etc for the reality editor :slight_smile:

Steps for running hybridobject server on Raspberry pi

NOTE : It will be better to update your raspberry pi before beginning the process

                  # sudo apt-get update
                  # sudo apt-get upgrade

Requirements :

1. Raspberrry pi ( server should work on any model , please report if any issues)
2. internet connection on the pi ( to use the vuforia portal ) , you can use a wifi adapter or directly connecct via LAN cable
3  iOS 7 or above device for reality editor

Steps :

1 .install nodejs on raspberry pi -->

// Getting the nodejs 4.0.0

wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv6l.tar.gz 1

tar -xvf node-v4.0.0-linux-armv6l.tar.gz

cd node-v4.0.0-linux-armv6l

sudo cp -R * /usr/local/

// updating it with node-arm files needed

wget http://node-arm.herokuapp.com/node_latest_armhf.deb 1

sudo dpkg -i node_latest_armhf.deb

2 download the object folder from --> https://github.com/openhybrid/object 1 as zip
OR you can also clone it to your pi directly using git clone

3 extract the zip file if you downloaded zip

4 go to the object folder from terminal

5 type npm install to install all required dependencies

6 after all dependencies are installed do node server.js or nodejs server,js to start the server

7 go to http://localhost:8080 2 from the PI’s browser , to access the hybrid-object interface

8 add objects and AR interfaces as given in http://openhybrid.org/first-steps.html 6

9 install reality editor on iOS device and connect to same network as the pi

Works like a charm. Thanks, @V_Mohammed_Ibrahim

Wonder if we should put those instructions in it’s own thread, or possibly the github README.md or wiki so it’s easier for other folks to find…

@KevinOrtman Thats a good Idea, I will add it to the open hybrid install guide on the webpage.
@V_Mohammed_Ibrahim is the guide above finished or should we add some more things before its added to the page?

I will also generate a drop down menu on the install page. By now we have a lot of guides.

Do you have some good sources for wiki systems that would allow use to rebuild the open hybrid webpage as a wiki? That would allow us to have more people involved in taking care of the webpage content.

@KevinOrtman did you have any difficulty during npm install ?

if there were no problems then the guide is is perfect , i had some doubts on weather npm would work ,
should we add any pics or will this be clear enough? @valentin

We do not need images If it is all command line.
Maybe you can add what a user would need. Similar we did it with the other install guides.

Do you think it will work with the RASPBERRY PI ZERO as well?

it should , ZERO has processing power and almost same features , the server should work , ZERO is not available here yet
@valentin the guide is finished :smile:

The Pi install guide is online and I have structured the Install Menu items in to sub-menus:

Sorry for the delay in getting back with you. I wanted to make 100% sure that the steps were accurate.
So, I re-imaged my sd card to try from scratch (base OS only) and tried multiple variations on the install steps. The install/restore process takes quite a long time, thus the delay.

@V_Mohammed_Ibrahim I found that following the exact steps outlined above failed to install serialport. In my case, the default nodejs instance need to be uninstalled first, and the install via node-arm was a bit flakey. I had a better install experience simply uninstalling the default nodejs then installing v0.12 via nodesource (GitHub - nodesource/distributions: NodeSource Node.js Binary Distributions).

Here’s what I ended up with:

How to install on a Raspberry Pi

  1. Use NOOBS 3 to install the base Raspian image.

  2. Update the system software.

    sudo apt-get update
    sudo apt-get upgrade -y
    
  3. Remove the default nodejs instance and replace it with v0.12 or higher (more details on nodesource github)

    sudo apt-get remove nodejs
    curl -sL https://deb.nodesource.com/setup_0.12 | sudo -E bash -
    sudo apt-get install -y nodejs
    
  4. Get the latest OpenHybrid Object code and download dependencies

    git clone https://github.com/openhybrid/object.git
    cd object
    npm install
    
  5. Run the OpenHybrid Object code

    node server.js
    

A this point, you should be able to navigate to port 8080 on your device and find the Object dashboard.

@KevinOrtman @valentin
my node version is 4.0.0 , old nodejs versions might cause problems,
you can update to node 4.0.0 using this
i have updated the instructions above with getting node 4.0.0, but that is too many instructions for a new user ,
we should update the guide in the site with @KevinOrtman instructions

Certainly.

The method works in that npm install completes successfully.
Server execution fails, however, with the following output. I’m in the process of debugging.

    pi@raspberrypi:~/object $ nodejs server.js
    got it started
    Loading template: base
    Starting System:
    Enter loadHybridObjects
    TempFolderName: null
    object Light1 has no marker yet
    TempFolderName: null
    object Light2 has no marker yet
    TempFolderName: null
    object test has no marker yet
    socket.io started
    Createing folder: /home/pi/object/objects/Light1/
    AddIO objectID: null   philipsHue
    Createing folder: /home/pi/object/objects/Light1/
    AddIO objectID: null   philipsHue
    it's all cleared
    Createing folder: /home/pi/object/objects/Light2/
    AddIO objectID: null   philipsHue
    Createing folder: /home/pi/object/objects/Light2/
    AddIO objectID: null   philipsHue
    it's all cleared
    found 1 internal server
    starting internal Server.
    webserver + socket.io is listening on port: 8080
    UDP listening on port: 52316
    base loaded !
    Loading template: documentation
    documentation loaded !
    Loading template: header
    header loaded !
    Loading template: home-object
    home-object loaded !
    Loading template: home-object-add
    home-object-add loaded !
    Loading template: interface
    interface loaded !
    Loading template: interface-rowitem
    interface-rowitem loaded !
    Loading template: monitor
    monitor loaded !
    Loading template: sidebar
    sidebar loaded !
    Loading template: target
    target loaded !
    events.js:85
        throw er; // Unhandled 'error' event
                ^
    Error: connect ECONNREFUSED
        at exports._errnoException (util.js:746:11)
        at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1012:19)

@V_Mohammed_Ibrahim do you get the same output when running the code in the beta branch on your Pi?

I should point out that master works without execption.

    pi@raspberrypi:~/object $ git checkout master
    Switched to branch 'master'
    Your branch is up-to-date with 'origin/master'.
    pi@raspberrypi:~/object $ nodejs server.js
    got it started
    Loading template: base
    object null has no marker yet
    object null has no marker yet
    object null has no marker yet
    socket.io started
    opneserial
    no problem
    found 2 internal server
    starting internal Server.
    webserver + socket.io is listening on port: 8080
    UDP listening on port: 52316
    Serial port error [Error: Cannot open /dev/ttyATH0]
    base loaded !
    Loading template: documentation
    documentation loaded !
    Loading template: header
    header loaded !
    Loading template: home-object
    home-object loaded !
    Loading template: home-object-add
    home-object-add loaded !
    Loading template: interface
    interface loaded !
    Loading template: interface-rowitem
    interface-rowitem loaded !
    Loading template: monitor
    monitor loaded !
    Loading template: sidebar
    sidebar loaded !
    Loading template: target
    target loaded !

@Carsten @valentin @V_Mohammed_Ibrahim

I was seeing that error because the philipsHue interface was enabled and trying to send an http request to a pH device. Should we set the exports.enabled flag to false by default?

I also ran across a few other minor items that could be improved while working through the code. I’ll submit a PR for your review.

Yes we should set the flag to false by default. The hue interface is very beta. It doesn’t have any error handling at all so far. At the moment it’s main purpose is to illustrate the use of the new API. I should have mentioned that in the comments.

I decided to focus on Pi <-> Hue comms before debugging my RE <-> Pi comms. I can load objects into my phone and see overlays, so I know I’m not too far away on the RE side.

It took me some time to get the Hue interface working, mostly because I’m barely competent, but it more or less works!

  • I learned enough curl to build Hue REST messages by hand. This was all new to me. Turns out the trickiest part is getting a valid username, and once I did that manually I just added that to the URL template so it’s still ugly, but functional. Getting IP address was pretty easy…lots of ways to do that, but from my phone app was easiest.
  • Took me awhile to figure out little things like the right ports. It’s 80 on mine, not 8000.
  • I added a level set to go with the state on/off. I re-learned vi a bit after a 20 year hiatus. Slow but steady progress…
  • Since I don’t have host comms working yet, I hacked in a level staircase that reads the level, adds a bit, writes the level, waits a while, and repeats. Sorta llike the generator loop I see in there to send to RE, only facing the lights instead.
  • It’s still a polling loop, reading the light state and trying to send it up to RE. I didn’t add change filtering yet.

It was cool for about 30 seconds. A light that ramps continually gets old pretty fast!

Thanks for the help!
Peter

Yes, that is what I started with. I learned enough Git to get the Beta down, and turned on the Hue interface (and off the Pi interface, though I’m running on a Pi). I’m not sure if it all works for Carsten, but for me it did not, and it included only on/off while I wanted slider control of brightness too.

And it doesn’t include learning a Hue bridge IP or creating a username, though I suspect most people (probably Carsten too) figured out how to get around that. I think earlier bridges were more lenient than the later ones, but I’m not sure – I know mine errors without authentication.

Mostly I’m learning a lot!
Thanks,
Peter

Did some old-school debugging on the Pi, with console.log all over the place in server.js. and index.js. Fixed a few reference errors and stuff, took out a line or two in server.js that I couldn’t tell what did (may regret this later?) but errored, and worked around a logic issue or two.

I now have two PhilipsHue lights with separate targets for which I can control levels from my iPhone using a slider overlay!

It is rather slow, as I have yet to clean up logging much, but it works!

I’ll think on this. My initial thought is that my opinion is of limited value because:

  1. I’m new to RE
  2. I’m new to JS and Python
  3. I’m new to Pi

I can say that even the “easy to use” Hybrid interface for the RE engine would be considered high-touch by most non-techies. Anything on Pi is pretty much the same. But, for those who say “it’s easy, it’s just standard Linux stuff”, I think either would work. Personally, now that I can kinda-sorta hack JS, it’ll keep me busy for a while. I believe data-flow diagrams with some pictures and arrows and some in-depth commenting would help.

I have further ambitions…I’ll see what I can butcher next!

Well, as I mentioned earlier, I created the hue interface mainly to test the new API I was developing. I didn’t really need it to do anything useful:

I think it’s quite impressive that you got it working for your needs @psomdecerff. I’m planning to make that interface usable, but it might take a while (with the holidays and everything). At the moment the hue interface can crash the whole system because I haven’t added any error handling yet. What I plan to do with it:

  1. Add error handling (check return state of http requests, check for the bridges return values,…)
  2. write values to the HybridObject server only if the value has actually changed
  3. Add a brightness I/O point
  4. Add a color I/O point

You are welcome to help implementing those points @psomdecerff and any other points I may have missed :smile:

Yeah, well, you will of course need a valid username and you need to know your bridges ip and port (I think all the bridges run on port 80 by default, I sometimes used this emulator 1 which can run on any port). When you refer to “most users”, you are probably talking about you and me, I don’t think anyone else is using the hue interface at this point :wink: We should definetly write some sort of introduction which explains those facts and include some links to philips Hue resources like Get Started - Philips Hue Developer Program and Login - Philips Hue Developer Program

@Carsten,
I didn’t do much to address lack of error handling, but then I didn’t mind crashes while debugging. It seems to run quite reliably, and you already did all the heavy lifting. I just tweaked around the edges.

  1. I think this will be quite straightforward for somebody who knows HTTP. Using curl the responses were easy to interpret, anyway.
  2. Good idea. Right now it doesn’t seem to hurt much, so I’m not in a hurry to address this, but if I get more bulbs I probably will. I may get some more today.
  3. Did this already.
  4. My daughter thinks this would be cool. I’m not sure what the control should be, though. Not on this week’s list.

I am not yet comfortable with Git, and don’t want to screw stuff up. If you like to play merge master and look over my modest changes, I will happily send them to you. So far I’ve made changes in a handful of files (from memory):

  • config.json – updated URL and IP. Most of the pain here was learning how to add a username for my bridge.
  • index.html – Started off with a version that had a slider for LED, and changed it to level. At this point I don’t recall what I grafted from where, but really the changes were pretty modest. Could use an on-off button too, but it works with slider alone.
  • hardwareInterfacesSomethingorother - only added some debugging I think, to writeIoToServer.
  • index.js – spent a good bit of time debugging the bulb interface. Added writeSwitchLevel (which is not a great name, in retrospect).
  • server.js – a little bit of debugging in the RE notification handler.

Regards,
Peter

It will take me a bit to figure out how, but yes. I’ll get a Git account and figure out how to do a fork, and start off with updating that. Right now my Pi is just a local clone.

Dumb Git questions below. I created a Git account, and made my own Git fork – psomdecerff/object – from the openHybrid project.

I think I successfully pointed my local clone to it.
pi@raspberrypi ~/beta/object $ git remote -v
origin https://github.com/openhybrid/object.git 1 (fetch)
origin https://github.com/openhybrid/object.git 1 (push)
upstream https://github.com/psomdecerff/object.git (fetch)
upstream https://github.com/psomdecerff/object.git (push)

I think I did a merge from upstream, and it didn’t complain. I also did a checkout, which shows several changed files; some I don’t recall changing but I may have while plinking early-on, and a couple of others I probably added a log to and then commented it out later.

pi@raspberrypi ~/beta/object $ git checkout
M hardwareInterfaces/philipsHue/config.json
M hardwareInterfaces/philipsHue/index.js
M hardwareInterfaces/raspberryPi/index.js
M libraries/HybridObjectsHardwareInterfaces.js
M libraries/templateModule.js
D objects/test/bird.png
D objects/test/index.html
D objects/test/object.js
M server.js
Your branch is ahead of ‘origin/beta_hardwareInterfaces’ by 7 commits.
(use “git push” to publish your local commits)

The issue I have is getting the changes to Push to my Github repository. It says it’s up to date when I just try “push” again, but I don’t see the changes online.

What detail am I missing somewhere?
Thanks!

I think I figured it out, using “phone a friend” option. Pull submitted for a handful of files with modest changes.

Sorry, @psomdecerff I just got home from work/dinner and checked this thread, so I missed your call for help. If you do have questions that need a timely answer, please don’t hesitate to ‘@’ name someone - I check email often, these forums less often.

That was a good pull request - great 1st PR ever! I see that Valentine has merged it, so I’ll grab the merged code and continue working with that.

No worries - I’m relatively patient and willing to dog through issues. I can’t imagine needing a rapid reply.

Thanks for merging it. Let me know if it doesn’t build for some reason. I think I included everything that I changed Do you want me to push an index.html for it too?

You mean like in the object/objects folder structure, right? I think that folder is more implementation specific and not typically distributed as part of the main project (?) that’s my impression anyways.

Let’s see what others say…

Hi @psomdecerff thanks for the commit. I added it to the project.
At some point it looked like you merged the master in to the beta branch. But the Master is very different from the beta branch in the moment. (I am sometimes confused about git my self.)
So I checkt through your code cleaned some of it up and compared it to the previous version of that branch.

There was one change in the server.js I was not quite sure about.
You commented an engine() call in line 1395. But that call is relevant to process links.
Was there some specific reason? Maybe a crash or something?

Something else we should maybe find a solution for,
I disabled all hardware interface by default, so that who ever wants to enable one should do that intentionally.

But I get error messages for onoff and the serialport (this is solved) on my mac.
What could we do, so that the packages are only loaded in case the hardware interface is really enabled?

@valentin, I probably did merge master – I’m sure I made several Git mistakes, hence my warning on looking closely at the pull.

The engine call threw an error I didn’t comprehend, yet the other internalModules call seemed to work fine. I haven’t played with links yet – is there a good example for those? I can uncomment and capture the crash, if that would help.

I agree that disabling all interfaces by default is a good idea. I kept having oddball objects laying around, and I accidentally re-used a target and confused myself even more.

You get an on-off error from my change? I’ll investigate tomorrow if I broke the beta.

@psomdecerff No problemo.
Your error could come from a strange mashup of code from the master that is different from the beta hardwareInterface.
I think the code is now all in sync with @KevinOrtman last commit.

Git is really a special kind of tool. I also still ask friends from time to time how to do certain things.
We are all learning :smile: