Comments (8)
@christianmackin was the content of conversation.js modified to require rpi-gpio as that's the module that the error message is complaining about. If so, package.json will also need to be modified to include rpi-gpio as a dependency.
from tjbot.
Hi @christianmackin,
Usually, running npm install
in the conversation or sit directory should install all the modules needed (including rip-gpio). Can you confirm that you are able to successfully run npm install
in the conversation directory? I'd suggest you delete your current node_modules
directory (removes the previous installation) and run npm install
again. If there are any errors with this .. please post below and we can continue troubleshooting from that point.
-V.
from tjbot.
You are awesome for replying so fast. Thank you.
I used the command 'rm -rf node_modules' and then 'npm install' from the conversation dir. Then sudo node conversation.js and received the same ERROR: Cannot find module 'rpi-gpio'
I looked in 'node_modules' and do not see a dir for 'rpi-gpio.' I don't know if that is an issue.
Previously after seeing the error, I followed the instructions to install rpi-gpio at https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-gpio
from tjbot.
I'm willing to reformat my RPi and start over if you think that is best. If so, can you provide the best workflow that starts from a brand new RPi 3 loaded from NOOBS? I have tried several of the Instructables and curls, but they all end in this problem. I must be doing something wrong in the workflow.
from tjbot.
Hi,
I'd recommend the manual setup here https://github.com/ibmtjbot/tjbot/tree/master/bootstrap.
Also, I'd recommend that you do not install modules globally "npm install -g".
One more thing ... on inspection we use the pigpio
library in tjbotlib and not rpi-gpio
. Any chance you can post your conversation file directory (e.g a repo?)
from tjbot.
I'm very embarrassed to say that this is all my fault. I modified the conversation.js file so that I could control the RPi GPIO by voice command in accordance with the following instruction
https://www.instructables.com/id/Turn-on-an-LED-With-Watson-Conversation/
http://www.zagrosrobotics.com/files/LED_Test2.js
I should have thought that could be an issue. After issuing the command 'npm install rpi-gpio' everything works fine now. It just needed that module installed in the home dir.
Notwithstanding the above, do you see a better way that I could control the RPi GPIO from within the original conversation.js and that would more fully interact with Watson? I think I am by passing much of the Watson functionality by coding everything into conversation.js. In other words, how can I use Intents, Entities, and Dialogs to control the GPIO as well as be able to send text strings back from Watson.
I would be happy to post a repo, but I don't know how.
from tjbot.
Hi,
Glad to know you have made progress with this!
To control gpio pins using watson conversation, you can extend the code in the conversation api.
To learn more about the tjbot library which is used in our conversation sample, please see the project description here - https://github.com/ibmtjbot/tjbotlib .
In the tjbot method used to handle conversation (tj.converse), it returns a response object from the ibm conversation service which you can then query to extract more information (e.g what intent was matched in the conversation tree etc) and then use this information to control GPIO .
A quick example
tj.converse(WORKSPACEID, turn, function(response) {
//print out the response object
console.log(response.object)
// speak the result
if (response.object.intents[0].intent == "lights"){
// do something to gpio .. control lights
}
});
In the sample above, your conversation workspace should be designed to have an intent called lights
which you can check for in order to control GPIO.
-V
from tjbot.
I have spent a few hours looking through the Library and trying some of the syntax shown there. I am only 50% successful in getting new syntax to work within conversation.js and I definitely don't follow your example. Do you have enough free time that you would be open to Freelancing? You can contact me directly through our website https://kohlex.com
from tjbot.
Related Issues (20)
- Find a new replacement for the Anker Mini Bluetooth Speaker, which has been discontinued HOT 2
- Write down the instructions for how to push out a new TJBot release
- Migrate instructions content to the GitHub wiki HOT 11
- Get started with Discussions
- Design new recipe that uses watsonx.ai to have TJBot tell a story
- Rename `conversation` recipe to `conversation-assistant` HOT 4
- Add new recipe for `conversation-watsonx` HOT 1
- Tag recipes based on which RPi hardware they support
- Update bootstrap with latest instructions for installing node.js on RPi
- Update `conversation_assistant` recipe to import ibm-cloud and use the assistant API directly HOT 2
- Figure out how to make `conversation_watsonx` work in javascript HOT 1
- Remove or rework `translator` recipe HOT 1
- Remove or rework `sentiment-analysis` recipe HOT 1
- Add python equivalents for existing recipes?
- Add temperature sensor support to speech_to_text
- Add temperature support to conversation_assistant
- Verify TJBot build, hardware tests, & recipes on RPi 5
- Clean out outdated recipes HOT 3
- Move API into Speech to Text recipe HOT 3
- Clean up filenames on 3D print pieces to make it clear what components are used on RPi 3/4/5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tjbot.