Yunadventures blogspot help

Hi, I'm a novice in the forum but this seems like the right place to ask. While I was scrolling through the

forum I noticed some people tried the project on yunadventures.blogspot ; Setting up the Yun to write

pin data to an onboard database, I had a problem, which was ;I'm not sure how to build the content of

the www folder, what I mean is I can't find all the files on the blogspot webpage. I wanted to ask for

help from those who were able to get this project to work.

Here is the link to it : Adventures with Arduino Yun: Setting up the Yun to write pin data to an onboard database

I'll be looking forward for any reply.

I don't see that it needs any other files. The sketch doesn't need any files in the www folder other than the database, and the article shows how to create that. Displaying the data in a web browser just needs the PHP file, I don't see where that file accesses anything but the database.

Did you try it? (I haven't.)

I did try actually with only those 2 files, php, and the arduino code, but it doesn’t seem to write to the

sqlite database, and I’m not able to view the php file in my browser. I think I’m also experiencing some

ssh problems because I can’t even view the files ; I’m sending some photos of it, main problem with ssh

seems like “access denied”.

I replied in your other post: you have the ls command line backwards: first comes ls, then any option switches like -l, and finally the name of the folder you are trying to list (or nothing for the current folder.)

At the beginning of the permission denied.jpg capture, you ran ls -l on your home folder, and it shows the test1.db file there. That's probably not where the sketch or php file is looking for the database file.

You might want to do a little reading up on using the Linux command line, starting with basic directory navigation commands

Get familiar with that much, and then make sure the files you want are in their expected places.

Ok. I think now all the files are in proper places, but I can’t get my sqlite3 database to update the table1.db

Here’s the arduino code, how the php file should look like and how it actually looks like. I also meant to ask,

I’m following sqlite3.jpg as it is without knowing too much about what actually is going on. I can’t thank

you enough for your help :smiley:

arduino code.txt (3.11 KB)

From the sketch, it looks like it is trying to write to the database file /mnt/sda1/arduino/www/test/test1.db

Is that where the file is actually located? From your previous directory listing that showed test1.db (near the top of the prior directory.jpg) it looks like it's in your home directory (as indicated by the ~ in the prompt.) For the root user, the home directory is /root. That's not where the sketch is trying to access the file.

The sqlite3.jpg capture is showing how to create the file, but it looks like it's skipping over the part where it says WHERE to create the file (unless that is scrolled off of the top of the screen.)

First, change to the /mnt/sda1/arduino/www/test folder:

cd /mnt/sda1/arduino/www/test

then follow the steps to create the database.

That will hopefully get you to where the sketch is properly updating the database. Hopefully that will also solve the PHP side of things.

Ok. now my database seems to be working, I mean it appears to update but I don’t know how to view it

besides the attached php file, which doesn’t seem to work. Can you have a look if you have some

knowledge? It displays like I’ve attached. I’m also attaching the directories and the database arguments

as they are given in the webpage.

table.txt (1.03 KB)

sqlitedirectorytable.jpg