Tag: Troubleshooting

  • Troubleshooting Phidgets

    Troubleshooting Phidgets

    What to Do When Roastmaster Can’t Connect to Phidgets

    Setting up a Phidgets network host is normally a quick and painless process. But, when something is not configured correctly, or other network problems occur, it can be intimidating and time-consuming to diagnose. Rainfrog does not author Phidgets software–neither do we have any insight into its internal workings. But…we have seen many Phidgets configuration and network problems, and we can probably help.

    We don’t want you to suffer alone, but before sending us a log file for troubleshooting, please read through the following configuration checklists. These were compiled from years of helping users just like you diagnose their network problems and configuration errors. Nothing on this page is filler. These have all, at one time or another, been real-world problems affecting a Phidgets network host installation.

    We’ve tried to present issues in the order of likelihood that it will help you diagnose your own Phidget host problems.

    1. Check the Link In Roastmaster
    2. Check the Network Host Computer
    3. Check the Phidgets Software Version
    4. Check Your Firewall Settings
    5. Check the Phidgets Network Server Logs
    6. Restart Your Host
    7. See Other Phidgets Issues

    If you still come up empty, submit a log file and ask us for help.

    In addition, you can also reach out to Phidgets directly. They have an excellent support department, and are very good at diagnosing issues and pinpointing problems.

    Check the Link In Roastmaster

    The details screen of a Phidgets probe definition in Roastmaster is the easiest way to determine if Roastmaster is communicating properly with a Phidgets device attached to your network host. Roastmaster will report a status of “Linked” if the Phidget host is powered on and relaying Phidget information over your WiFi network. All you need to do is define a reading curve in a roast, and bind this probe to that curve to view and log temperature readings as you roast.

    If this screen reports a status of “Unlinked”, however, the network host is not properly conveying Phidget information to Roastmaster. This is usually due to a configuration error or software problem on the host, or a network topology problem.

    Check the Network Host Computer

    Roastmaster communicates with Phidgets via a “host” computer that shares the data of any Phidgets attached to it with Roastmaster via your wireless WiFi network. See How Do Phidgets Work? for more information.

    • Verify that the host is powered on and not in a low-power or sleep state
    • Verify that the desired Phidgets are properly attached to the host with the correct USB cables
    • Verify that the Roastmaster iOS device and the host computer are both joined to the same WiFi network

    Check the Phidgets Driver Software on the Host

    Roastmaster 11.0 (October 2017) and later requires Driver Library 22 to be running on your host. Lib22 shares Phidget information with Roastmaster via its “Network Server” software. This must be configured and running for Roastmaster to connect to Phidgets attached to your host.

    Once Lib22 has been installed on the host, verify the following in the Phidgets Control Panel application of your Mac or Windows host that was installed as part of Lib22. SBC users can find these settings in the Phidgets > phidget22 Network Server tab of the SBC Administration Console.

    1. Verify that Phidget Network Server is Enabled and Published
    2. Verify that an arbitrary Server Name (ID) is entered and contains no illegal characters
    3. Verify that a Port is entered
    4. Verify that the Password field is blank
    5. Verify that the Network Server is active. “Network Server is Running” should be displayed

    If you make changes to any of the above items, it is usually necessary to REBOOT the host after applying/saving the changes. Restarting the Network Server software alone (depending on the situation) is often not enough.

    Roastmaster 10.1 and earlier requires Driver Library 21 of the Phidgets software. Lib21 shares Phidget information via its “WebService”. This must be configured and running for Roastmaster to connect to its Phidgets.

    Check Firewall Settings

    A firewall’s purpose is to make your network and computer as safe as possible from unauthorized access and malicious attacks. One way firewalls accomplish this is by blocking unrecognized or suspicious traffic. If a firewall somewhere on your network is enabled with aggressive settings, it may erroneously block the TCP port traffic that the Phidgets Network Server is sending across your network. This can be a firewall on either the host computer, or the router itself. To troubleshoot…

    1. Try disabling any firewall on your host machine or network
    2. Restart the network host computer
    3. Relaunch Roastmaster
    4. See if a connection is established

    If connection is achieved, then the firewall is the culprit. First, re-enable the firewalls. Then add an exception rule to the offending firewall that allows ANY traffic on the TCP port specified in the Phidgets Network Server software.

    When using a Windows machine as a network host, it is usually necessary to add firewall exception rules to the Windows firewall, in order to allow the Network Server to operate. You will need to add both an inbound and outbound rule.

    MacOS and SBC users do not usually have to worry about this, though it can vary–depending on firewall settings on the host computer.

    Check the Phidgets Network Server Logs

    The Lib22 Phidget Network Server software records noteworthy events in a log file called “phidget22networkserver.log”. This file contains detailed information about connections and any errors the Network Server may encounter.

    For example, the following log entry describes a problem in which the Network Server cannot start due to an invalid apostrophe character in the Name (ID) field…

    ERR [phidget22net][2017-10-27T11:41:40 servers.c+997 startServer()]: server name contains invalid characters (‘”‘ or ‘\’)? ‘John’s MacBook’

    In the above example, the formal typographer’s apostrophe ’ is the offending character. Replacing it with an ASCII single quote character will allow the Network Server to start correctly.

    If you cannot connect to your network host from Roastmaster, the log will usually provide information to help you determine why.

    MacOS

    The log file is located at /Library/Logs/phidget22networkserver.log. To view the file, open the Console application located in utilities, and select “/Library/Logs”, then “phidget22networkserver.log”. Or, navigate to that directory in the Finder.

    Windows

    The log file is located at C:/ProgramData/Phidgets/logs/phidget22networkserver.log. To view the file, click “Logs” in the bottom right of the Phidgets Control Panel, or navigate to this directory.

    SBC

    The log file is located at /var/log/phidget22networkserver.log. To view the file, launch the Phidgets Administration Console from the Phidgets Control Panel on a laptop computer. In the Administration Console, navigate to the System > File Editor tab. In the list of directories, click the “var” directory, followed by the “log” directory. The phidget22networkserver.log can be downloaded to your desktop by clicking it.

    Restart Your Host

    Yes, it is often necessary to perform a complete restart of your network host to clear old network sockets and caches when making changes to the Phidget Network Server settings. Simply restarting the Network Server software is often not enough. Perform a reboot by first powering down your host, then booting normally. SBC users can reboot from the System > Reboot tab in the Administration Console.

    When restarting your host, it’s a good idea to relaunch Roastmaster so you can start with a clean slate.

    1. Double-tap the home button on your iOS device. This will display all the apps currently running.
    2. Find the Roastmaster screen and swipe upwards to terminate it.
    3. Relaunch as usual.

    Other Phidgets Issues

    Most Phidget host or network configuration problems can be resolved by the preceding suggestions and settings. The following suggestions, though, may offer some insight into tougher connection problems or other sporadic issues.

    Cause

    Description

    Aggressive FirewallNo connection

    Roastmaster reads Phidget data from a host via a TCP “port”. In networking, ports are designated by numbers, and segregate types of traffic, e.g. 80 for web traffic, 20 or 21 for FTP traffic, etc.

    All firewall(s) on your network must allow both inbound and outbound traffic on the TCP port that is specified in the Phidget Server section of the host Phidget software.

    1. First, verify that the firewall (if any) on the host is allowing inbound and outbound traffic.
      • Windows host: If you are using a Windows machine as the host, you will almost certainly need to add both an inbound and outbound “exception” rule to the Windows firewall for TCP traffic on the applicable port.
      • Mac host: Adding firewall exceptions is usually not necessary.
      • SBC host: Adding firewall exceptions is usually not necessary. 
    2. Then, make sure the firewall running on the router itself allows the same traffic. WiFi routers will typically allow Phidget Server traffic by default, but if you suspect your router is blocking Phidget traffic, you may wish to add exception rules to this firewall as well.
    Mismatched or outdated Phidgets driversNo connection

    The Phidgets software running on the host must be compatible with the Phidgets software running in Roastmaster.

    For Roastmaster 11.0 or higher, please use Driver Library 22.

    For Roastmaster 10.1 or lower, please use Driver Library 21.

    Multiple Simultaneous connectionsNo connection

    Roastmaster and Phidgets support multiple simultaneous connections to a Phidget host from the same hardware device. But multiple simultaneous connections to a host from DIFFERENT hardware devices are NOT supported by the Phidget Server software.

    If you are experiencing a connection problem, please verify that no other users are currently using the Phidget device(s) in question. Even the “monitoring utility” included in the Phidgets software counts as a connection. Please make sure that the monitoring utility is closed as well when attempting a connection from Roastmaster.

    Note: It is often necessary to stop and restart the Phidget Server on the host to clear old connections from its cache.

    Invalid server nameNo connection

    Only certain ASCII characters are permissible in a Network Server host name (ID). Formal typographer’s single and double quote marks, slashes and other special characters are not allowed, and will prevent the Network Server from starting.

    Missing information in Roastmaster’s probe details screen.No connection

    Roastmaster requires a serial number and probe port for each probe definition in order to make a connection. Please ensure that the serial number you use is for the Temperature Sensor itself, and NOT the SBC that it is attached to.

    Roastmaster or host not joined to the WiFi networkNo connection

    Roastmaster and the host computer must both be joined to the same WiFi network for a connection to occur.

    WiFi bottlenecksSporadic connection/dropouts

    Many things can place a strain on your network bandwidth: Audio streaming with Pandora, iHeart radio, iTunes radio, etc, or video streaming via Facebook, YouTube, etc. VOIP/internet phone systems can also occupy an appreciable amount of your available bandwidth.

    If the WiFi network becomes congested, the Phidgets WebService may have a hard time keeping up with the demands, and drop connections sporadically.

    Try eliminating as much unnecessary network traffic as possible.

    Insufficient WiFi rangeNo connection/sporadic connection

    The best possible WiFi range that can be expected indoors with 802.11b/g is 150 ft. This is greatly reduced by obstructions: corners, stairs, floors, etc., and by electronic interference: cell phones, RF products, electronic motors, etc.

    Dead SBC EEPROM batteryNo connection

    If the EEPROM battery on an SBC has been exhausted, the SBC may “forget” its network setting when rebooting, resulting it not joining the WiFi network when restarting. The network information will need to be input again, and the batter will need to be replaced in order to remember this information between reboots.

    Bad or missing themocoupleNo connection/erroneous reading

    If the probe attached to the applicable port is damaged (or if no probe is present at all) the temp sensor will not be able to accurately perform its cold/hot junction algorithms.

    Roaster housing interferenceNo connection, sporadic connection or erroneous readingsMetal roaster housings can pick up electrical noise and transfer that to a thermocouple as electronic interference. This can interfere with the temp sensor’s ability to perform its cold/hot junction compensation and algorithms, resulting in erratic temperature readings.

    Newer roasters may have better grounding, anticipating the popularity of data logging. Older roasters, however, sometimes just employ an iron ferrite bead somewhere in the pathway of the thermocouple leads, as a means to filter out the inherent interference.

    Electronic interference can be combatted by one of two means:

    1. Isolate the probe from the roaster completely by changing a grounded/unshielded probe to an ungrounded/shielded type.
    2. Wrapping the probe leads around a ferrite bead (or using a clamp-style ferrite core around the leads).
    Piggy-backed or spliced probe leads.No connection, sporadic connection or erroneous readings

    The voltages used by thermocouples is extremely low. Therefore, thermocouple leads can never be safely spliced, or split to provide output to two different sets of electronics.

    Consider installing a dedicated probe for Data Logging, or switching to a dual-tip probe.

    Reversed PolarityNo connection or erroneous readings

    Make sure the polarity of the probe leads is correct.

    Radio InterferenceNo connection, sporadic connection or erroneous readings

    RF products (cordless phones, intercom systems, electronic equipment, etc) can cause enough radio interference to create connection issues.

    Try turning off sources of RF interference to see if this is the culprit.

    Incorrect alloy type set in RoastmasterNo connection or erroneous readings

    Verify that the correct alloy type is specified in Roastmaster (K or J).

    Incorrect passwordNo connection

    Roastmaster 10.2 no longer supports the Phidget password field on a host. If you have passwords defined in Roastmaster, remove them.

    In Roastmaster 10.1 and earlier, make sure the password entered in the probe definition exactly matches the password entered in the Web Service field of the host.

    Damaged or incompatible USB cableNo connection

    Replace the USB cable with a compatible USB cable (preferably the cable that came with your Phidget).

    Ask Us for Help

    If you have consulted this guide, and still cannot get a Phidgets connection, please don’t hesitate to ask for help. Locate the network server log file of your host. Make a copy of this file and email it us. We can compare it to the log file of a functioning installation, and possibly offer some insight. Please be sure to include the following in your email.

    1. The “phidget22networkserver.log” log file as an attachment. We cannot offer support without this file.
    2. The version of Roastmaster you are using. This can be found in the “About” window of the main app menu.
    3. The version of Phidgets Lib22 that is installed on your host.
    4. The type and version of operating system running on your host, e.g. OS X 10.12.6, Windows 10, etc.
    5. A summary of your problem
  • Database Error 1002

    Database Error 1002

    This issue was resolved in Roastmaster 7.0.2

    With iOS 7, Apple ushered in a lot of changes, both in the look of the OS as well as much of its underlying functionality. One of the more impactful changes for Roastmaster was a big shift in how Core Data operates with SQL databases like Roastmaster’s. As with any shift in technology, it has not been without its share of bumps in the road.

    It has surfaced since iOS 7 that in two uncommon scenarios, Roastmaster may display “Error opening database: 1002 – Could not perform compatibility check” when either launching the app and opening the main database, or manually opening any other database.

    Why Does This Happen?

    If you encounter this error due to either of the following two situations, do not fear – your data is not gone, Core Data is simply refusing to open it.

    In BOTH of these cases, I can easily and quickly reset the offending “flag” in the database file, and send it back to you in its original operational state. This error can present due to one of two situations:

    You have recently experienced an unexpected shutdown of your iOS device. This can be due to a hard reset of the device (such as in a hang, freeze or kernel panic), or due to the device shutting down on its own (such a in a low battery situation, or other iOS or hardware malfunction).

    If an iOS device experiences a core OS freeze, and a hard reset is performed, or the OS unexpectedly reboots for another reason, iOS may fail to reset the “busy” flag of the database files, causing Core Data to reject the database the next time you attempt to open it because it thinks the files are already in use.

    I can easily reset the busy flag by simply opening it in an external SQLite editor, exporting it via Roastmaster and sending right back to you.

    You have just restored or setup an iOS device from an iCloud or iTunes backup

    During the backup process, when iCloud or iTunes encounter a Roastmaster database file (.sqlite), it notices its two supporting cache files (.wal and .shm) and coalesces all three into a single, portable .sqlite file, in a process similar to what Roastmaster performs when you export a database. The single resulting .sqlite file(s) are backed up to iTunes or iCloud and stored in the device backup. This all happens transparently in the backup process.

    It appears that in the coalescing process, iTunes and iCloud fail to reset the journal mode on the database(s) from WAL mode (3 files) to DELETE mode (1 file). During the restore, it restores an intact .sqlite file, but since the journal mode is erroneously left as WAL, iOS expects the 2 supporting files. When it does not find them, it refuses to open the database.

    I can easily recreate the extraneous cache files by simply opening it in an external SQLite editor, exporting it via Roastmaster and sending right back to you.

    How Do I Get My Data Back?

    Regardless of which of these situations has presented itself, your data can be easily retrieved.

    If You Have an Exported Backup (or can make one from another device)

    If you have an external backup that is up to date, or are able to export an up-to-date file from another Roastmaster installation, this is the easiest way. Just import the resulting sqlite backup file into Roastmaster, and open that database by tapping the logo on the home screen, tapping the database button and opening it manually.

    If You Do Not Have a Backup

    You will need to send your database folder to me and I will “reset” the database. All that is required on my end to simply open the database in an external SQL editor. This will either A) reset the “busy” flag if it was left marked as “in use” after an unexpected reboot or B) reset (what I believe) to be an erroneous journal mode not properly set during the coalesce phase of the iTunes/iCloud backup.

    In most cases I can do this immediately and return the database file back to you for easy import, and you will be up and running in no time.

    Since Roastmaster actually opens a database to prep it for export, you will not be able to export the database from the app. You will need to use iTunes file sharing to copy the databases folder to your desktop by following these steps:

    1. Tether the device to iTunes
    2. In the “File Sharing” pane of the “Apps” tab, select Roastmaster
    3. In the “Roastmaster Documents” pane, find the “Databases” folder and copy the folder to your desktop
    4. ZIP that folder and email it to support@rainfroginc.com

    I will return a single database file that can be easily imported from Dropbox or email or copied to your Roastmaster documents folder via iTunes file sharing, then choosing “Import from documents” from Roastmaster’s home screen.

    When Will This Be Fixed?

    Unfortunately, it does not appear that I can do anything to fix either of these bugs until the actual causes are revealed. The bugs lie in either iCloud, iTunes or iOS itself – it’s unclear at the moment. I’ve filed two separate bug reports with Apple outlining the problem, and how to reproduce it.

    If you’ve found this page after encountering this error, PLEASE let me know – even if you don’t need my help in resetting your database. The more users I can report having this issue, the higher priority Apple is likely to assign to getting it fixed for good.