w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
connect to raspberry pi through public internet
First, you should make sure that the ssh daemon is installed properly on your RP. You can install it with sudo apt-get update && apt-get install ssh Next, you should try to connect to your SSH server locally, that means, open up a terminal directly on your RP and try to connect to your locally running SSH server: ssh root@localhost Or even better, use the current IP address of the RP instead of localhost. If you can connect, everything works on this side. Now you can try to connect to your RP from another box inside your local network. It should also work. If it does not, you most probably have a firewall blocking outgoing SSH connections on this box, or your RP itself is blocking incoming connections. Usually, it should not block it, unless you configured something like that

Categories : Linux

Connect to old mysql installation using python-mysql,
You probably need to use an other connector. MySQL-python seems to support MySQL3.23+. mysql-connector-python simply can't connect using old authentication.

Categories : Python

`connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)
Find your socket file using mysqladmin variables | grep socket And then add the socket file to your database.yml configuration development: adapter: mysql2 host: localhost username: root password: xxxx database: xxxx socket: <socket location>

Categories : Mysql

Python cannot connect to MySQL if declare in a class
You are passing a dictionary object self.configs into mysql.connector.connect, though, according to docs, you should pass to it user, password and other arguments. Looks like you need to unpack configs: self.connection = mysql.connector.connect(**self.configs) Hope this is it.

Categories : Python

Python code to establish an ssh to remote server and then connect to MYSQL
The ip address "127.0.0.1" that you use in your connection object refers to localhost, which is the computer the program is running on. You can't remotely connect to the localhost of another computer. You need to replace the host ip address with the ip address of the remote server. Also you should only need the MySQLdb.connect object, not the ssh object if you connect correctly.

Categories : Python

How do I open up my MySQL on my Raspberry Pi for Outside / Remote Connections?
I have recently had the same problem myself. I got it working by doing the following: Edit MySQL configuration By default, MySQL is not configured to accept remote connections. You can enable remote connections by modifying the configuration file: sudo nano /etc/mysql/my.cnf Find the [mysqld] section. The line you need to alter is bind-address, which should be set to the default value of 127.0.0.1. You want to edit this line to instead show the IP of your RPi on the network (which would seem to be 192.168.1.102 from your example). Write the changes. Restart the MySQL service sudo service mysql restart Setup MySQL permissions Connect to your MySQL instance as root: mysql -p -u root Create a user: CREATE USER '<username>'@'<ip_address>' IDENTIFIED BY '<password&g

Categories : Mysql

NFC tag reading in python on raspberry pi
There are lots of links on google wherein you can find information on data format used in NFC. Some of them are http://learn.adafruit.com/adafruit-pn532-rfid-nfc/ndef http://developer.nokia.com/Community/Wiki/Understanding_NFC_Data_Exchange_Format_(NDEF)_messages

Categories : Python

Raspberry Pi Python PWM RuntimeError: No access to /dev/mem
The problem is with the code above is that I forgot to set RED to at output before trying to use it. The error message did not help resolve this problem. Next time, I need to remember to setup PWM pins as outputs before trying to use them.

Categories : Python

Raspberry PI: PHP call python script with sudo
Mm, i have try with this two simple example: /Scripts/test.py #!/usr/bin/env python print (str('hello world')) /var/www/test.php <?php echo shell_exec('/Scripts/test.py'); ?> via a browser, show me "hello world" Perhaps try this: chmod a+x your_py_file.py Hope that help..

Categories : Nginx

Using Python smbus on a Raspberry Pi - confused with syntax
I'm absolutly not sure this is the problem, but according to the specs p22: MMA7660FC is read using it’s internally stored register address as address pointer, the same way the stored register address is used as address pointer for a write. The pointer generally auto-increments after each data byte is read using the same rules as for a write (Table 5). Thus, a read is initiated by first configuring the device’s register address by performing a write (Figure 11) followed by a repeated start. The master can now read 'n' consecutive bytes from it, with the first data byte being read from the register addressed by the initialized register address. As far as I understand, to "read" from a register, you have to start by writing the register address, and then blindly read a byte

Categories : Python

Unable to login to MYSQL getting error ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
It seems like a permission issue, try disabling selinuza by using setenforce 0, then restart the mysql service, also check if mysql has the right permissions on the mounted device (assuming you mounted as root or a sudo user that mysql cannot access)

Categories : Mysql

Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) Fedora Linux
What i can think right now if you've already tried the solutions in your link, is that SELinux (Fedora's) is blocking service. try sudo setenforce 0 and then sudo service mysqld start let me know if it helped please

Categories : Mysql

Running Python script causes Raspberry Pi to lose power
I tried your script. It locks up the rpi at this line GPIO.setup(6,GPIO.IN,pull_up_down=GPIO.PUD_DOWN) GPIO06 isn't one of the pins on the GPIO port. You'd have look at the schematic to see what it's connected to. Looks like it's LAN_RUN. What are you trying to do with it? From elinux.org GPIO06 is LAN_RUN and is available on pad 12 of the footprint for IC3 on the Model A. On Model B, it is in use for the Ethernet function. So unless you have a model A, you shouldn't be using GPIO06

Categories : Python

No video file created by OpenCV 2.3.1 with Python on Raspberry Pi
I eventually went through and tried all of the fourcc codecs and none worked. Same with the mpeg2 codec. I ended up using avconv to create and capture the video with this line: import os os.system("avconv -f video4linux2 -input_format mjpeg -i /dev/video0 output.avi") os.system() is used to run a terminal command. OpenCV can still be used to process the video files at a later time. Hope this helps someone.

Categories : Opencv

Twisted Python script on Raspberry Pi (Debian) to communicate with Arduino via USB
Judging from this: http://twistedmatrix.com/trac/browser/tags/releases/twisted-12.3.0/twisted/internet/_win32serialport.py#L84 you should be looking at dataReceived(self,...) method of your Protocol subclass Thus: class USBclient(Protocol): def connectionMade(self): global serServ serServ = self print 'Arduino device: ', serServ, ' is connected.' def cmdReceived(self, cmd): serServ.transport.write(cmd) print cmd, ' - sent to Arduino.' pass def dataReceived(self,data): print 'USBclient.dataReceived called with:' print str(data) try this to see if it works.

Categories : Python

Raspberry pi will not send serial data to an arduino using either minicom or python
You need to read up on the difference between arduino and raspPI 'serial' pins - in short, their voltage levels are quite different and require a conversion cable between the two of them to adjust these levels.

Categories : Python

How can I make a connection between Raspberry Pi and a Bluegiga WT11i Bluetooth Module using Python?
Got it!! pi@raspberrypi ~ $ aptitude install bluetooth pi@raspberrypi ~ $ hcitool dev Devices: hci0 00:07:80:54:CA:E2 pi@raspberrypi ~ $ hcitool scan Scanning ... 00:07:80:54:CA:E2 BGWT11i pi@raspberrypi ~ $ bluez-simple-agent hci0 00:07:80:54:CA:E2 Enter PIN Code: 1234 Now I can connect ... pi@raspberrypi ~ $ python rfcomm-client.py 00:07:80:54:CA:E2

Categories : Python

Porting Python Raspberry Pi application to Twisted - how to handle background threads that poll the hardware
You can use LoopingCall (howto) to schedule a repeated function call on a certain interval. This probably replaces your polling threads entirely.

Categories : Python

Python having trouble accessing usb microphone using Gstreamer to perform speech recognition with Pocketsphinx on a Raspberry Pi
So I finally got this guy working. Couple key things I needed to realize: 1. Even if you're using Pulseaudio on your Raspberry Pi, as long as Alsa is still installed you're still able to use it. ( This might seem like a no brainer to others, but I honestly didn't realize I could still use both of these at the same time ) Hint via (syb0rg). 2. When it comes to sending large amounts of raw audio data ( .wav format in my case ) to Pocketsphinx via Gstreamer, (queues) are your friend. After messing around with gst-launch-0.10 on the command line for a while I came across something that actually worked: gst-launch-0.10 alsasrc device=hw:1 ! queue ! audioconvert ! audioresample ! queue ! vader name=vader auto-threshold=true ! pocketsphinx lm=/home/pi/dev/scarlettPi/config/speech/lm/scarlett

Categories : Python

Trying to connect to mysql server for the first time and get an error messange: "mysql: command not found"
Your terminal application doesn't know where to locate the mysql program. For example, if you installed xampp in C:/xampp, you open a command prompt, cd to C:/xampp/mysql/bin and then run your command, which should work now. Edit: Just remembered you mentioned OSX, regardless, use the same principle. In your terminal, cd to the XAMPP install subfolder which contains the mysql executable app

Categories : PHP

mysql error Can't connect to local MySQL server through socket '192.168.250.99'
You have to bind your server to that specific IP address So add this to your my.cnf under [mysqld] bind-address=192.168.250.99 or write bind-address = 0.0.0.0 for all ip addresses

Categories : Mysql

Unable to connect to any of the specified mysql hosts. C# MySQL
i tooth you are writing the port no on wrong place , also you are using short name PASS it's not working use PASSEWORD do it like this . and i hop it will work as you want. MySqlConnection mysqlConn=new MySqlConnection("SERVER=127.0.0.1:3306;UID=pankaj;PASSWORD=master;DATABASE=patholabs;"); mysqlConn.Open(); best of luck

Categories : C#

When using 32bit version of MySQL's .net connector to connect to a 64bit version of MySQL I get " Waiting for table metadata lock "
This doesn't sound like it has anything to do with 64/32 bit from the error message given. Have a look at this SO question and answer and see if that gives any clues: How do I find which transaction is causing a "Waiting for table metadata lock" state?

Categories : Mysql

MySQL Connector/Python - insert python variable to MySQL table
just had the same issue. Are you using numpy? One of your passed values could be of type numpy.float64 which is not recognized by the mysql connector. Cast it to a genuine python float on populating the dict. This worked for me. hth, gr~~~

Categories : Python

How can I connect two mysql using while?
You should run mysql_query($query) 1 time not in loop. Your code makes running mysql_query in every loop. Remove from: while($rows = mysql_fetch_array(mysql_query($query))) //HERE^ Do: <?php $query = "SELECT * FROM servers"; $result = mysql_query($query); while($rows = mysql_fetch_array($result)){ // do more stuff

Categories : PHP

connect mySQL with Nodejs
Error is not strictly connected to mysql module. Probably you are behind the proxy, try to follow the instruction how to setup npm behind the proxy here: http://jjasonclark.com/how-to-setup-node-behind-web-proxy

Categories : Mysql

Can't get glassfish to connect to mysql
If you are using a Glassfish-initiated JDBC connection (I think you are since you say you sucessfully pinged the datasource), then you don't want to define the properties as you have them in the persistence.xml. You'll want to just specify a data-source by JNDI name. <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="HelloWorld"> <non-jta-data-source>jdbc/myds</non-jta-data-source> <class>model.HelloWorld</class> <properties> </properties> </persistence-uni

Categories : Mysql

Can't properly connect to MySql with PDO
Change $db = new PDO( 'mysql:host = '.$config['db']['host'].'; dbname = '.$config['db']['dbname'], $config['db']['username'], $config['db']['password'] ); to $db = new PDO('mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], $config['db']['username'], $config['db']['password'] ); or $db = new PDO( "mysql:host={$config['db']['host']};dbname={$config['db']['dbname']}", $config['db']['username'], $config['db']['password'] ); Apparently MySql PDO driver doesn't like spaces in DSN. mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'] ^^ ^^

Categories : PHP

Cannot connect to MySQL via XAMP
First locate your XAMPP install C:Program Filesxampp for a full install. Open a new Command Prompt Window: Click Start Type "cmd" Hit enter In Command prompt go to the XAMPP directory do not include the C: part cd path oxampp Start MySql: mysqlinmysql.exe -u pingu -p

Categories : Mysql

How to connect MySQL with Java?
You should be getting NPE. As you are executing your querie on dbCon and not on dbcon // initialize here Connection dbcon = DriverManager.getConnection( "jdbc:mysql://localhost:3306/EMPLOYEE", "root", "root"); String query ="select count(*) from EMPLOYEE4 "; // Null here Connection dbCon = null; // on dbCon which is null stmt = dbCon.prepareStatement(query); EDIT THis how your code suppose to look like. Connection dbcon = DriverManager.getConnection( "jdbc:mysql://localhost:3306/EMPLOYEE", "root", "root"); String query = "select count(*) from EMPLOYEE4 "; Statement stmt = dbcon.createStatement(); ResultSet rs = stmt.executeQuery(query);

Categories : Java

Cannot connect to MySQL using MySQLi_connect
Try this, $con = mysqli_connect("localhost","root","abcd123","payrolldb001") or die("Error " . mysqli_error($con)); $sql="SELECT substationid,substationcode FROM wms_substation WHERE assemblylineid = '".$q."'"; $result = mysqli_query($con,$sql); ... Or $con= mysqli_connect("localhost","root","abcd123") or die ("could not connect to mysql"); mysqli_select_db($con,"payrolldb001") or die ("no database"); Read mysqli_select_db

Categories : PHP

Couldn't connect to a MySQL DB via JWS app
Please ensure the MySQL is running in default port 3306 else you need change the port number accordingly. Connection connection = DriverManager.getConnection( "jdbc:mysql://www.lmntstudio.cz:3306/javadb", "username", "password"); instead of www.lmntstudio.cz you can use ip of the domain. run the following in the command line to get the ip cmd prompt> nslookup www.lmntstudio.cz The Url syntax as follows jdbc:mysql://(host/ip):port/databasename", "username", "password"

Categories : Java

Error trying to connect to MySql using DSN
rags comment (above) wasn't the solution, but it definitely helped track it down. When using a full connection string the error message was different and much more useful, the driver failed to load. The issue seems to be that since I'm on a 64 bit machine it was the 64 bit driver. VB6 can't use the 64 bit driver and the 32 bit driver doesn't show up in the ODBC Connection Administrator on a 64 bit machine. DSN is not an option in my machine.

Categories : Mysql

app can't connect to local MySQL - osx
The error indicates that "mysql is not started/running". From what you describe, looks like the new location pointed to the alias has no mysql or its mysql is not started. Look my.cnf file with the correct parameters in the new location: /Applications/MAMP/Library/bin/mysql Another trick is to list your running processes and look for mysql. Also, are you sure, "rails c" is not using the sqlite3 vs mysql? Updated: *Courtesy of @bfavaretto MySQL 'my.cnf' location? By default, the OS X installation does not use a my.cnf, and MySQL just uses the default values. To set up your own my.cnf, you could just create a file straight in /etc. OS X provides example configuration files at /usr/local/mysql/support-files/ Update: Take a look at this: Getting "Can't connect...th

Categories : Mysql

Mysql-client cannot connect new ip
this may be a DNS cache issue. Try flushing your cache. If you are on windows/osx, look at this: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/ClearingBrowserCache I'm not sure what has to be done on Linux. (Flush on CLIENT side, by the way).

Categories : Mysql

Can't connect to Mysql - issue with my.cnf
I ran in to the same problem after restarting my EC2 server - I couldn't connect to mysql. When I ran: sudo /opt/bitnami/ctlscript.sh status it said that mysql was not running. I had to do sudo service mysql stop sudo /opt/bitnami/ctlscript.sh restart mysql

Categories : Mysql

Not able to connect to a Win Xp server with MySql
A couple of things can block connections to your machine: a firewall on your WinXP server skip_networking in the MySQL server configuration no access rights for root@some-ip, but only for root@localhost Error messages would really help ;) And you should now, that official support for WinXP will end soon. So I would not recommend installing new software on a Win XP machine. Edit: Ho do you connect to your server? What program do you use?

Categories : Mysql

Connect to a mysql database via SSH through PHP
I think you are out of luck on this one. You can either use the ssh extension in your PHP code, or if you have access to the server, you could try to create a ssh tunnel on the command-line. You probably need special permissions to do that, though. It also looks like you don't have ssh access to this hosting account. duplicate answered by @jpm Setting up tunneling posted by @Ólafur Waage on Connect to a MySQL server over SSH in PHP And this one for tunneling by @Sosy shell_exec(“ssh -f -L 3307:127.0.0.1:3306 user@remote.rjmetrics.com sleep 60 >> logfile”); $db = mysqli_connect(’127.0.0.1′, ‘sqluser’, ‘sqlpassword’, ‘rjmadmin’, 3307);

Categories : PHP

How to connect with MySql in GWT? (AppEngine)
Well the bottom line is you have really messy code. There are many violations to good coding practice. From the code you included this line never gets executed: con = DriverManager.getConnection( url,"root", ""); So there is no connection to your db. Does your exception indicate that this line Statement st = con.createStatement(); is the problem?

Categories : Java

ASP.NET use SqlConnection Connect Mysql
SqlConnection is for SQL Server. You need MySqlConnection - This is not part of the .NET Framework so you will have to download it and reference it in your project. You can then create a MySqlConnection object and connect to MySQL in your application: MySqlConnection connection = new MySqlConnection(myConnString); You will also have to use the MySqlCommand object rather than the SqlCommand object. http://dev.mysql.com/doc/refman/5.0/es/connector-net-examples-mysqlconnection.html

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.